Skip to content
Snippets Groups Projects
Commit 83aaaa1e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

trying to get this to work on windows

parent 72ee09cb
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ class drawContextFltkCairo::queueString {
_totalWidth = 0;
_maxHeight = 0;
}
~queueString()
{
for(std::vector<element>::iterator it = _elements.begin(); it != _elements.end(); ++it) {
......@@ -84,16 +84,18 @@ class drawContextFltkCairo::queueString {
glScalef (2.0f / winw, 2.0f / winh, 1.0f);
glTranslatef (-winw / 2.0f, -winh / 2.0f, 0.0f);
//write the texture on screen
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glEnable (GL_TEXTURE_RECTANGLE_EXT);
glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_LIGHTING);
glDisable (GL_DEPTH_TEST);
glEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glGenTextures (1, &textureId);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, textureId);
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_ALPHA, cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface), 0,
GL_ALPHA, GL_UNSIGNED_BYTE, cairo_image_surface_get_data(surface));
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, textureId);
glTexImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, GL_ALPHA,
cairo_image_surface_get_width(surface),
cairo_image_surface_get_height(surface), 0,
GL_ALPHA, GL_UNSIGNED_BYTE, cairo_image_surface_get_data(surface));
//glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_SRC0_ALPHA);
//printf("error %i %s\n", __LINE__, gluErrorString(glGetError()));
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
......
......@@ -75,15 +75,15 @@ class drawContextFltkStringTexture::queueString {
glScalef (2.0f / winw, 2.0f / winh, 1.0f);
glTranslatef (-winw / 2.0f, -winh / 2.0f, 0.0f);
//write the texture on screen
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glEnable (GL_TEXTURE_RECTANGLE_EXT);
glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_LIGHTING);
glDisable (GL_DEPTH_TEST);
glEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glGenTextures (1, &textureId);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, textureId);
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_ALPHA, w, h, 0,
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, textureId);
glTexImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, GL_ALPHA, w, h, 0,
GL_ALPHA, GL_UNSIGNED_BYTE, data);
//glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_SRC0_ALPHA);
//printf("error %i %s\n", __LINE__, gluErrorString(glGetError()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment