Thank you very much for your help! Me too not a expert of OpenGL but sure, you know it better than me becuse i am new in OpenGL and my English isn't very good to understand everything.
For starters, get rid of the "ekran" variable and use screen or temp in its place.
Look at this thread: http://www.gamedev.n...g-glreadpixels/
Check what is the value of gluErrorString(glGetError()) after the call to glReadBuffer. Overall, the code seems legit, but I'm not an OpenGL expert by any means.
Do you draw something in OpenGL? When do you call this Screenshot function?
GL_FRONT_AND_BACK seems to be illegal value for glReadBuffer. Try with GL_FRONT_LEFT instead. Quoting the documentation:
Specifies a color buffer.
Accepted values are
where i is between 0 and the value of GL_AUX_BUFFERS minus 1.
Nonstereo double-buffered configurations have only a front left and a back left buffer
Oh, i am an idiot First, I might say thats:
Already, I called Screenshot function with screen surface and drew something to screen.The problem weren't them.
When i tried GL_FRONT_LEFT, i made it just and i have a question: why doesn't it be when i tried GL_FRONT_RIGHT instead?
What is different between LEFT and RIGHT? Does it mean front face and back face. I will try all of them.