Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: OpenGL scene overlaps windows controls c++ winapi

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2013

    OpenGL scene overlaps windows controls c++ winapi

    Hi there!
    I'm trying to create simple button on top of openGL scene, but I have one serious problem.
    I am using double buffer and when I want to draw the button, it is covered by the openGL scene.
    The whole openGL window is in fullscreen mode (WS_POPUP) and when I use WS_CLIPSIBLINGS and WS_CLIPCHILDREN window style for the parent window,
    the area of the button is filled with Visual Studio background. But when I minimize that window and maximize again, the button is drawn but it has no text on it.
    FPS in the scene also dramatically drop when I just create the button. I have no idea what can I do to fix that.
    Any help would be appreciated. Thank You in advance!

  2. #2
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Innsbruck, Austria
    I'm not sure if that is actually supposed or intended to work, or how the WS_POPUP window fullscreen mode internally works, but I imagine it to be quite messy and only a hack to turn ownership of entire rendering device/screen over in order to get most performance. I don't know (and don't really want to know) the internal workings of those particular parts of the WINAPI so I personally would not try that to begin with.

    Either way, if you want GUI inside a fullscreen GL application you are probably way better off using an existing GUI library specifically designed for drawing GUI stuff via OpenGL(R), either using GL drawing functions or drawing offscreen and uploading to a texture.

    Here are a few libraries I know of:

    • Ant tweak bar
    • MyGui
    • CEGUI
    • You could use the SGUI offscreen canvas and upload the data to a GL texture
    • A few years ago, I managed to get QT to draw to an offscreen memory buffer that can also be upload to a GL texture

    If you insist on using the WINAPI controlls, there might be some way to get them to draw offscreen and then upload that to a texture.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2013
    Actually my idea was to create editbox as a text input window, the button was just for testing purposes.
    I want to keep the visual interface of the windows controls and mainly the funcionality as copying text, pasting text,
    mooving carret possition using arrow keys on keyboard and so on.
    Either way, thank you for your advices, I will try one of them.
    Drawing the controls to a texture sound like a great soloution, we will see what impact will it have on performance

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts