OpenGL within C++
Posted: Sun Apr 29, 2007 5:05 pm
Hi Guys,
I've a question for C++ & OpenGL gurus.
I've a class called Bitmap having a member (array of bytes) called "buffer"
I need to call glDrawPixels() from a member function called "display()"
but "buffer" is not just a pointer, so how to pass "buffer" to glDrawPixels()
Any solutions rather than plotting pixel by pixel ???
Thanks alot
I've a question for C++ & OpenGL gurus.
I've a class called Bitmap having a member (array of bytes) called "buffer"
I need to call glDrawPixels() from a member function called "display()"
but "buffer" is not just a pointer, so how to pass "buffer" to glDrawPixels()
Code: Select all
class Bitmap
{
private:
int x, y;
BYTE *buffer;
public:
void display();
}
void Bitmap::display()
{
glDrawPixels(x, y , GL_BGR_EXT, GL_UNSIGNED_BYTE, buffer);
}
Thanks alot