Windows 7/10 x64
If a Window containing an OpenGL Gadget is minimised, on restore the OpenGL Gadget back colour becomes that of the Window back colour.
Work around is to apply glClearColor, glClear and SetGadgetAttribute #PB_OpenGL_FlipBuffers (e.g. using a Macro)
5.71LTS OpenGL Gadget back colour lost on Window Restore
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
5.71LTS OpenGL Gadget back colour lost on Window Restore
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: 5.71LTS OpenGL Gadget back colour lost on Window Restore
An OpenGLGadget() is not double buffered and can't redraw automatically its last buffer (unless I miss something in OpenGL API), so you need to redraw it when the window size change on Windows. I updated the doc.
Re: 5.71LTS OpenGL Gadget back colour lost on Window Restore
(lots of communication attacks... no links with the forum)
I confirm the "redraw". I suggest grab from draw to video memory (gl function).
I have a small example about resizing glGadget, I must refind.
I confirm the "redraw". I suggest grab from draw to video memory (gl function).
I have a small example about resizing glGadget, I must refind.
Re: 5.71LTS OpenGL Gadget back colour lost on Window Restore
Mby we can test it like this:
Code: Select all
Procedure.i HasDoubleBuffer()
Protected hdc.i
Protected pfd.PIXELFORMATDESCRIPTOR
hdc = wglGetCurrentDC_()
If DescribePixelFormat_(hdc,GetPixelFormat_(hdc),SizeOf(PIXELFORMATDESCRIPTOR),@pfd)
ProcedureReturn Bool(pfd\dwFlags & #PFD_DOUBLEBUFFER)
EndIf
ProcedureReturn #False
EndProcedure
Re: 5.71LTS OpenGL Gadget back colour lost on Window Restore
@mijikai
I am not sure it is useful in the way where a window (a view gadget) is resizing.
-> How could the API adapt a new set of dimension through two buffers ?
-> In the way where the scale is kept (that was my way), the matrix changes.
I am not sure it is useful in the way where a window (a view gadget) is resizing.
-> How could the API adapt a new set of dimension through two buffers ?
-> In the way where the scale is kept (that was my way), the matrix changes.