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>
Sat, 11 Jun 2016 07:07:08 +0000 (03:07 -0400)
- Matrix was not being set
- Avoid querying current program
- Using GL_ALPHA rather than GL_RED

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

index 7176ad8..eafad3b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -660,7 +660,9 @@ endif
        install $(OBJLIBDIR)libecereVanilla$(A) $(DESTSLIBDIR)/
        install -d $(DOCDIR)/
        install doc/tao.pdf $(DOCDIR)/"Ecere Tao of Programming [work in progress].pdf" >/dev/null 2>&1 || echo "The Ecere Tao of Programming is available at http://ecere.com/tao.pdf"
-       $(call cpr,$(DOC)/*.econ,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecere/,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecereCOM/,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/EDA/,"$(DOCDIR)/")
        mkdir -p $(MANDIR)/man1
        cp -pRf share/man/man1/* $(MANDIR)/man1
        mkdir -p $(SAMPLESDIR)
@@ -732,7 +734,9 @@ ifdef BSD_HOST
        install $(INSTALL_FLAGS) -d $(DOCDIR)
 endif
        install $(INSTALL_FLAGS) -m 644 doc/tao.pdf $(DOCDIR)/"Ecere Tao of Programming [work in progress].pdf" >/dev/null 2>&1 || echo "The Ecere Tao of Programming is available at http://ecere.com/tao.pdf"
-       $(call cpr,$(DOC)/*.econ,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecere/,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecereCOM/,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/EDA/,"$(DOCDIR)/")
        mkdir -p $(MANDIR)/man1
        cp -pRf share/man/man1/* $(MANDIR)/man1
        mkdir -p $(SAMPLESDIR)
index 41efbeb..9e87e36 100644 (file)
@@ -1206,7 +1206,7 @@ public:
    {
       int mindex;
       float norminv;
-      if(!prevProgram)
+      if(!flags.prehistoricOpenGL && !prevProgram)
          glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *)&prevProgram);
       // while(glGetError());
 
@@ -1233,6 +1233,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 )