[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Det er ved hjælp af OpenGL muligt at uploade sine textures til hardwaren. Så det går hurtigt !!!
GLuint textID[1];
glGenTextures(1, &textID[0]);
glBindTexture( GL_TEXTURE_2D, &textID[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, &image);
// ... Senere i programmet...
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, &textID[0]);
glBegin( GL_QUADS );
glTexCoord2i(0, 0); glVertex2i(...);
glTexCoord2i(0, 1); glVertex2i(...);
glTexCoord2i(1, 1); glVertex2i(...);
glTexCoord2i(1, 0); glVertex2i(...);
glEnd(); glDisable( GL_TEXTURE_2D );
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |