Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Qt5.1 beta] OpenGL, white screen
Forum Updated to NodeBB v4.3 + New Features

[Qt5.1 beta] OpenGL, white screen

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bilouse
    wrote on last edited by
    #1

    Hi !

    I am a complete beginner in OpenGL (Windows x64)

    I used this example from KDAB :
    http://www.kdab.com/opengl-in-qt-5-1-part-1/

    The code is exactly the same, except a dynamic_cast on this line:
    @m_funcs = m_context->versionFunctions()@

    And whatever I do, I get a white window.

    A @m_funcs->glClearColor(0.0f, 0.0f, 0.0f, 1.0f)@

    is expected to show a black background, isn't it ? It's always a white background, nothing is displayed.

    I also tested with a OpenGL 3.3 context.
    My drivers are updated, there must be something I did not understand ...

    (sorry, my English must be deplorable)

    Thanks !

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Skyrpex
      wrote on last edited by
      #2

      Hi Bilouse,

      you must perform some other calls in order to see something into the screen.

      @m_context->makeCurrent( this ); // Make sure you make the context current
      m_funcs->glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Specify the color that glClear(...) will use
      m_funcs->glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); // Actually, clear the window with the color mentioned above
      m_context->swapBuffers( this ); // Send the data to the window
      @

      Edit: I recommend you to download the tesselation example at the bottom of the "5th Qt5.1 post at KDAB":http://www.kdab.com/opengl-in-qt-5-1-part-5/

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved