Now I want to do the same with OpenglES but I don’t have glReadBuffer and glDrawBuffer, so I tried remove them but it didn’t work because the opengl scene didn’t refresh the resize.
Someone know how to replace the glReadBuffer and glDrawBuffer functions? Because I didn’t found a solution.
Thanks a lot
Santiago
Assuming you have an egl implementation on your platform, I’d suggest the eglMakeCurrent, eglSwapBuffers functions depending on what exactly your application is doing. If you don’t have egl, then you’ll need to use whatever native graphics framework to manage your color buffers.
Also keep in mind, GLES does not include any window resizing callbacks like those available in GLUT for desktop GL. So if your mingling GLUT functions calls with GLES function calls be mindful of the fact things may not work as expected, if at all.
I upload a screenchot to make it clear.
When I resize the window I expect to happen what you can see on the right, but I obtain the result that you can see on the left.
The lines are bigger than the original size but the scene has the same size than the original.
If you asked me about the swapBuffers… I don’t know why I do a swapBuffer, I’m a newbie and I tried different things to see if I can correct my problem.
Thanks
It looks like your viewport is not updated with the correct window dimensions after your window is resized. How are you detecting when a resize of your window occurs? The win32 api generates a WM_SIZE event when a window resize occurs which can use to update the viewport with the correct dimensions.
You will need to create new rendering surface matching the new window size and re-associate them with the context. As the previous reply indicated, this needs to happen as response to WM_SIZE.