Jump to content

  • Log In with Google      Sign In   
  • Create Account

Erik Rufelt

Member Since 17 Apr 2002
Offline Last Active Jun 15 2016 08:30 AM

Posts I've Made

In Topic: WinAPI + OpenGL: Change window style and/or resolution

03 June 2016 - 03:09 PM

Is that FRAPS display always active?  If so, try disabling it.. it probably overrides a bunch of GL calls to put its overlay there.


In Topic: WinAPI + OpenGL: Change window style and/or resolution

03 June 2016 - 10:59 AM

Try updating your graphics drivers if you don't have the newest stable one already..

From your images it seems clear that the OpenGL part stays right where it was in respect to the top-left corner of the window (not the just the client-area).. whereas I guess the top left part that was the border before gets the background-color..

Could be a difference in what theme is used in Windows or if there are any window-helper plugins or something that causes the difference in behavior on different computers..

Try dragging another window on top of the window with the error and see if the OpenGL drawn part is properly updated..

I guess you call PumpMessages from a loop and always do glClear and Swap after that?

You could try only calling DefWindowProc always and skip any viewport and resize handling etc as glClear and Swap don't care about the viewport anyway, and maybe add a Sleep(10) or something in the loop to avoid insane update-rates..


In Topic: WinAPI + OpenGL: Change window style and/or resolution

03 June 2016 - 08:31 AM

I don't get it.. does it not work?  I ran your program and see nothing strange.. maybe a difference between Windows versions or something..

You should post a single-file source code we can run instead of an exe if possible.

 

Anyway, I think your window styles look weird. Especially setting the style when going back to windowed mode.. save the style when you decide to switch to fullscreen and restore it to the saved style when going back to windowed.. removing the fullscreen style bits will break if the windowed mode has any of the same bits set. Many window-styles are combinations of several bits.

Also it looks really complicated, too much code to combine the styles, very difficult to follow exactly what bits will remain in the end.. easy to miss things.

 

I don't get making the window area the same either.. if you want a particular window-area in client-mode then handle that.. but what is the point of a borderless window that doesn't cover the screen?

 

Also getting multiple WM_SIZE shouldn't matter, you could get that anyway if the window is resized, I don't think those messages are supposed to be relied on to send an exact size exactly once or things like that. I'm not sure a resize or especially a style-change is guaranteed to be in any way atomic with respect to the message queue.


In Topic: WinAPI + OpenGL: Change window style and/or resolution

01 June 2016 - 04:43 PM

Show your game loop with PeekMessage as well as the WndProc.


In Topic: WinAPI + OpenGL: Change window style and/or resolution

01 June 2016 - 01:57 PM

An interesting difference: when creating a window I define a style based on the parameters. The return value of SetWindowLongPtr is the previous window style which should be the same as the manually defined style, but it's not. Is that normal?

 

Depends, it can have WS_VISIBLE and others added.. also many styles commonly used when creating a window are actually combinations of several sub-styles.


PARTNERS