ecere/gfx/newFonts/DrawManager: Fixes for FFP GL support
authorJerome St-Louis <jerome@ecere.com>
Mon, 29 Feb 2016 05:31:00 +0000 (00:31 -0500)
committerJerome St-Louis <jerome@ecere.com>
Wed, 2 Nov 2016 16:32:44 +0000 (12:32 -0400)
- Matrix was not being set
- Avoid querying current program
- Using GL_ALPHA rather than GL_RED

ecere/src/gfx/newFonts/drawManager.ec
ecere/src/gfx/newFonts/fontRenderer.ec
ecere/src/gfx/newFonts/textureManager.ec

index eb57b8a..330a022 100644 (file)
@@ -1202,7 +1202,7 @@ public:
    {
       int mindex;
       float norminv;
-      if(!prevProgram)
+      if(!flags.prehistoricOpenGL && !prevProgram)
          glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *)&prevProgram);
       // while(glGetError());
 
@@ -1229,6 +1229,16 @@ public:
       orderBarrierMask = 0;
 
       updateCount++;
+
+      if(flags.prehistoricOpenGL)
+      {
+         glMatrixMode(GL_PROJECTION);
+         glLoadMatrixf(matrix);
+
+         glMatrixMode(GL_MODELVIEW);
+         glLoadIdentity();
+         glScalef(4,4,4);
+      }
    }
 
    void drawImage( DMImage image, int offsetx, int offsety, int sizex, int sizey, uint32 color )
index 0d76759..8acd718 100644 (file)
@@ -106,12 +106,15 @@ public:
    {
      if(texture)
      {
+#ifdef SHADERS
         int glformat = GL_RED;
+#else
+        int glformat = GL_ALPHA;
+#endif
         int w = rect[2] - rect[0];
         int h = rect[3] - rect[1];
 
-        if( channelcount == 1 )
-          glformat = GL_RED;
+        if( channelcount == 1 );
         else if( channelcount == 2 )
           glformat = GL_RG;
         else if( channelcount == 3 )
index cdca66f..a441b31 100644 (file)
@@ -64,7 +64,13 @@ public:
      int glformat;
 
      if( image.format.bytesPerPixel == 1 )
+     {
+#ifdef SHADERS
        glformat = GL_RED;
+#else
+       glformat = GL_ALPHA;
+#endif
+     }
      else if( image.format.bytesPerPixel == 2 )
        glformat = GL_RG;
      else if( image.format.bytesPerPixel == 3 )