-
glDrawPixels()
Hi -
I don't know if anyone can help, but I want to use glDrawPixels(). I want to use my own created colour buffer which so far is an array of self made variable Colour. But I'm not sure how to go about this, anyone have any solutions/suggestions?
My current solution which doesn't work is:
glDrawPixels(400, 400, GL_RGB, GL_FLOAT, colourBuffer);
Cheers
HELS
-
You should look up the documentation for that API as it's pretty complicated with all the different modes that need to be set.
Here is the link to the MSDN page: (Note, certainly not the only documentation out there)
http://msdn.microsoft.com/library/de...unc01_6lbn.asp
-
But my problem is the very last bit I need to include, which is const GLvoid *pixels. What form is this ment to be in. The only explanation is that it is a pointer to the pixel data. But my colourBuffer is a pointer to the pixel data and it just isn't working and I don't know what else to do :(
HELS
-
You specify the format and the type when you call the function. That's how it knows what to expect. You have format as GL_RGB and type as GL_FLOAT. So if I had to guess it would expect a pointer to a bunch of triplets of floats.
r0, g0, b0, r1, g1, b1, r2, g2, b2, ... , r399, g399, b399
Something like that.
-
...but it is very slow. As of right now I don't think there is a way to simply retrieve a pointer to the buffer. Unfortunate.