ecere/gfx/GL: Standardized on _GLES for ES 1.1 and _GLES2 for ES 2.0
authorJerome St-Louis <jerome@ecere.com>
Fri, 1 Apr 2016 22:10:47 +0000 (18:10 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sat, 11 Jun 2016 07:07:11 +0000 (03:07 -0400)
- Added MinEmscripten config (No bitmaps, freetype, 3D)
- Fixed bug in matrixStack's glLoadMatrix
- Fixed shading.ec compilation with ECERE_NO3D
- Static config changes

ecere/ecere.epj
ecere/src/gfx/3D/models/Object3DSFormat.ec
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec
ecere/src/gfx/drivers/gl3/glab.ec
ecere/src/gfx/drivers/gl3/matrixStack.ec
ecere/src/gfx/drivers/gl3/shading.ec
ecere/src/gfx/newFonts/drawManager.ec
ecere/src/gfx/newFonts/fontRenderer.ec
ecere/src/gfx/newFonts/textureManager.ec
samples/guiAndGfx/mandelbrot/mandelbrot.epj

index ccd7a04..a35f85c 100644 (file)
@@ -478,10 +478,26 @@ if distributed with the Ecere SDK Windows installer.
       {
          "Name" : "Emscripten",
          "Options" : {
-            "Optimization" : "Speed",
             "PreprocessorDefinitions" : [
                "ECERE_STATIC",
-               "NOBLENDING"
+               "NOBLENDING",
+               "ECERE_NOSSL"
+            ],
+            "TargetType" : "StaticLibrary",
+            "TargetFileName" : "ecereStatic",
+            "FastMath" : true
+         }
+      },
+      {
+         "Name" : "MinEmscripten",
+         "Options" : {
+            "PreprocessorDefinitions" : [
+               "ECERE_STATIC",
+               "NOBLENDING",
+               "ECERE_NOSSL",
+               "ECERE_NO3D",
+               "ECERE_NONET",
+               "ECERE_NOTRUETYPE"
             ],
             "TargetType" : "StaticLibrary",
             "TargetFileName" : "ecereStatic",
@@ -699,6 +715,12 @@ if distributed with the Ecere SDK Windows installer.
                                  }
                               }
                            ]
+                        },
+                        {
+                           "Name" : "MinEmscripten",
+                           "Options" : {
+                              "ExcludeFromBuild" : true
+                           }
                         }
                      ]
                   },
@@ -831,6 +853,12 @@ if distributed with the Ecere SDK Windows installer.
                            "Options" : {
                               "ExcludeFromBuild" : true
                            }
+                        },
+                        {
+                           "Name" : "MinEmscripten",
+                           "Options" : {
+                              "ExcludeFromBuild" : true
+                           }
                         }
                      ]
                   },
@@ -933,6 +961,12 @@ if distributed with the Ecere SDK Windows installer.
                                  "Options" : {
                                     "ExcludeFromBuild" : true
                                  }
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Options" : {
+                                    "ExcludeFromBuild" : true
+                                 }
                               }
                            ]
                         },
@@ -953,6 +987,12 @@ if distributed with the Ecere SDK Windows installer.
                                        "Options" : {
                                           "ExcludeFromBuild" : true
                                        }
+                                    },
+                                    {
+                                       "Name" : "Static",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
                                     }
                                  ]
                               },
@@ -1007,6 +1047,12 @@ if distributed with the Ecere SDK Windows installer.
                                        "Options" : {
                                           "ExcludeFromBuild" : false
                                        }
+                                    },
+                                    {
+                                       "Name" : "MinEmscripten",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : false
+                                       }
                                     }
                                  ]
                               },
@@ -1060,6 +1106,12 @@ if distributed with the Ecere SDK Windows installer.
                                        "Options" : {
                                           "ExcludeFromBuild" : false
                                        }
+                                    },
+                                    {
+                                       "Name" : "MinEmscripten",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : false
+                                       }
                                     }
                                  ]
                               },
@@ -1107,6 +1159,12 @@ if distributed with the Ecere SDK Windows installer.
                                        "Options" : {
                                           "ExcludeFromBuild" : false
                                        }
+                                    },
+                                    {
+                                       "Name" : "MinEmscripten",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : false
+                                       }
                                     }
                                  ]
                               },
@@ -1123,7 +1181,7 @@ if distributed with the Ecere SDK Windows installer.
                                     {
                                        "Name" : "Static",
                                        "Options" : {
-                                          "ExcludeFromBuild" : false
+                                          "ExcludeFromBuild" : true
                                        }
                                     },
                                     {
@@ -1184,6 +1242,12 @@ if distributed with the Ecere SDK Windows installer.
                                        "Options" : {
                                           "ExcludeFromBuild" : false
                                        }
+                                    },
+                                    {
+                                       "Name" : "MinEmscripten",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : false
+                                       }
                                     }
                                  ]
                               },
@@ -1231,6 +1295,14 @@ if distributed with the Ecere SDK Windows installer.
                               "gl_compat_4_4.h",
                               "fixed.frag",
                               "fixed.vertex"
+                           ],
+                           "Configurations" : [
+                              {
+                                 "Name" : "Static",
+                                 "Options" : {
+                                    "ExcludeFromBuild" : false
+                                 }
+                              }
                            ]
                         },
                         {
@@ -1309,6 +1381,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1388,6 +1471,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1467,6 +1561,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1491,6 +1596,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : false
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1591,6 +1707,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "linux",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1708,6 +1835,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1751,6 +1889,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1830,6 +1979,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1898,6 +2058,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "Static",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "win32",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1956,6 +2127,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "linux",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -1976,6 +2158,12 @@ if distributed with the Ecere SDK Windows installer.
                                  "Options" : {
                                     "ExcludeFromBuild" : true
                                  }
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Options" : {
+                                    "ExcludeFromBuild" : true
+                                 }
                               }
                            ]
                         }
@@ -2020,7 +2208,15 @@ if distributed with the Ecere SDK Windows installer.
                         "IncludeDirs" : [
                            "src/gfx/newFonts/cc"
                         ]
-                     }
+                     },
+                     "Configurations" : [
+                        {
+                           "Name" : "MinEmscripten",
+                           "Options" : {
+                              "ExcludeFromBuild" : true
+                           }
+                        }
+                     ]
                   },
                   "Bitmap.ec",
                   "BitmapResource.ec",
@@ -2207,6 +2403,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "linux",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -2363,6 +2570,17 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Platforms" : [
+                                    {
+                                       "Name" : "linux",
+                                       "Options" : {
+                                          "ExcludeFromBuild" : true
+                                       }
+                                    }
+                                 ]
                               }
                            ]
                         },
@@ -2385,6 +2603,12 @@ if distributed with the Ecere SDK Windows installer.
                                  "Options" : {
                                     "ExcludeFromBuild" : false
                                  }
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Options" : {
+                                    "ExcludeFromBuild" : false
+                                 }
                               }
                            ]
                         },
@@ -2430,6 +2654,12 @@ if distributed with the Ecere SDK Windows installer.
                                        }
                                     }
                                  ]
+                              },
+                              {
+                                 "Name" : "MinEmscripten",
+                                 "Options" : {
+                                    "ExcludeFromBuild" : true
+                                 }
                               }
                            ]
                         },
@@ -2556,6 +2786,12 @@ if distributed with the Ecere SDK Windows installer.
                            "Options" : {
                               "ExcludeFromBuild" : true
                            }
+                        },
+                        {
+                           "Name" : "Emscripten",
+                           "Options" : {
+                              "ExcludeFromBuild" : true
+                           }
                         }
                      ]
                   }
@@ -2583,6 +2819,12 @@ if distributed with the Ecere SDK Windows installer.
                            }
                         }
                      ]
+                  },
+                  {
+                     "Name" : "MinEmscripten",
+                     "Options" : {
+                        "ExcludeFromBuild" : true
+                     }
                   }
                ]
             },
index 9ab905b..899ec34 100644 (file)
@@ -3,14 +3,16 @@ namespace gfx3D::models;
 import "Object"
 
 #if defined(__EMSCRIPTEN__)
-#define ES2
+#if !defined(_GLES2)
+#define _GLES2
+#endif
 #endif
 
 #if defined(__ANDROID__) || defined(__ODROID__)
-#define ES1_1
+#define _GLES
 #endif
 
-#if !defined(ES1_1) && !defined(ES2)
+#if !defined(_GLES) && !defined(_GLES2)
 #define USE_32_BIT_INDICES true
 #define indicesMember indices32
 #define uintindex uint32
index 4bcf703..7b0c4c1 100644 (file)
@@ -2,9 +2,7 @@
 
 namespace gfx::drivers;
 
-#if defined(_GLES)
-   #define ES1_1
-#else
+#if !defined(_GLES)  // OpenGL ES 1
    #define SHADERS
 #endif
 
@@ -112,8 +110,8 @@ import "shading"
    #endif
 
    #if defined(__ANDROID__) || defined(__ODROID__)
-      #if defined(__ODROID__) && !defined(ES1_1)
-         #define ES1_1
+      #if defined(__ODROID__) && !defined(_GLES)
+         #define _GLES
       #endif
 
       #define uint _uint
@@ -145,8 +143,10 @@ import "shading"
       #undef class
 
    #elif defined(__EMSCRIPTEN__)
-      #define ES2
-      // #define ES1_1
+#if !defined(_GLES2)
+      #define _GLES2
+#endif
+      // #define _GLES
 
       #define property _property
       #define uint _uint
@@ -307,7 +307,7 @@ private:
    #define APIENTRY
 #endif
 
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
 
    #undef glRecti
    #undef glBegin
@@ -391,7 +391,7 @@ public void glesColorMaterial(int a, int b)
 }
 
 static GLuint stippleTexture;
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
 static bool stippleEnabled;
 #endif
 
@@ -462,7 +462,7 @@ void glDrawPixels(int a, int b, int c, int d, void * e) { }
 static int primitiveTypes[RenderPrimitiveType] =
 {
    GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN,
-#if defined(SHADERS) || defined(ES1_1) || defined(ES2)
+#if defined(SHADERS) || defined(_GLES) || defined(_GLES2)
    GL_TRIANGLE_FAN,     // NOTE: This will only work for single quads
 #else
    GLIMTKMode::quads,
@@ -501,7 +501,7 @@ public void GLSetupLighting(bool enable)
 
 // Non OpenGL ES friendly stuff
 
-#if defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
 
 //#undef GL_UNSIGNED_INT
 //#undef GL_DOUBLE
@@ -1689,7 +1689,7 @@ class OpenGLDisplayDriver : DisplayDriver
       {
          oglDisplay.flipBufW = width;
          oglDisplay.flipBufH = height;
-#if defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
          result = true;
 #else
          oglDisplay.flippingBuffer = renew oglDisplay.flippingBuffer ColorAlpha [width * height];
@@ -2228,7 +2228,7 @@ class OpenGLDisplayDriver : DisplayDriver
 
       glColor4fv(oglSurface.foreground);
       glBegin(GL_LINES);
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
       if(stippleEnabled)
       {
          glTexCoord2f(0.5f, 0);
@@ -2261,7 +2261,7 @@ class OpenGLDisplayDriver : DisplayDriver
       //Logf("Rectangle\n");
 
       glColor4fv(oglSurface.foreground);
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
       if(stippleEnabled)
       {
          glBegin(GL_LINES);
@@ -2725,7 +2725,7 @@ class OpenGLDisplayDriver : DisplayDriver
 
       if(stipple)
       {
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
          stippleEnabled = true;
          glesLineStipple(1, (uint16)stipple);
 #else
@@ -2735,7 +2735,7 @@ class OpenGLDisplayDriver : DisplayDriver
       }
       else
       {
-#if defined(ES1_1) || defined(ES2) || defined(SHADERS)
+#if defined(_GLES) || defined(_GLES2) || defined(SHADERS)
          stippleEnabled = false;
          glMatrixMode(GL_TEXTURE);
          glLoadIdentity();
@@ -2764,7 +2764,7 @@ class OpenGLDisplayDriver : DisplayDriver
 #endif
             break;
          case fillMode:
-#if !defined(ES1_1) && !defined(ES2)
+#if !defined(_GLES) && !defined(_GLES2)
             glPolygonMode(GL_FRONT_AND_BACK, ((FillModeValue)value == solid) ? GL_FILL : GL_LINE);
 #endif
             break;
@@ -3353,7 +3353,7 @@ class OpenGLDisplayDriver : DisplayDriver
    {
       if(vboAvailable)
       {
-#if defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
          if(indices32bit)
          {
             if(!oglIndices.buffer.buffer)
@@ -3501,7 +3501,7 @@ class OpenGLDisplayDriver : DisplayDriver
          {
             OGLIndices oglIndices = primitive->data;
             GLEAB eab = ((!display.display3D.collectingHits && oglIndices && vboAvailable) ? oglIndices.buffer : noEAB);
-#if defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
             if(!vboAvailable && primitive->type.indices32bit)
             {
                uint16 * temp = new uint16[primitive->nIndices];
index dc913fe..b304700 100644 (file)
@@ -1,8 +1,6 @@
 // GL Array Buffer Manipulation
 
-#if defined(_GLES)
- #define ES1_1
-#else
+#if !defined(_GLES)
  #define SHADERS
 #endif
 
@@ -14,7 +12,9 @@
 #elif defined(__EMSCRIPTEN__)
    #include <GLES2/gl2.h>
 
-   #define ES2
+#if !defined(_GLES2)
+   #define _GLES2
+#endif
 
    #define GL_INT    0x1404
    #define GL_DOUBLE 0x140A
@@ -120,7 +120,7 @@ public struct GLAB
 
    void useVertTrans(uint count, int n, int type, uint stride, void * pointer)
    {
-#if defined(_GLES) || defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
       if(glabCurArrayBuffer != ((this != null) ? buffer : 0) && vboAvailable)
          GLABBindBuffer(GL_ARRAY_BUFFER, ((this != null) ? buffer : 0));
       if(type == GL_INT)
@@ -184,7 +184,7 @@ public struct GLEAB
       {
          if(glabCurElementBuffer != ((this != null) ? buffer : 0))
             GLABBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ((this != null) ? buffer : 0));
-#if defined(_GLES) || defined(ES1_1) || defined(ES2)
+#if defined(_GLES) || defined(_GLES2)
          type = GL_UNSIGNED_SHORT;
 #endif
          glDrawElements(primType, count, type, indices);
index 355536e..6dd68fe 100644 (file)
@@ -31,6 +31,28 @@ public union Matrix
       m[0][0]=m[1][1]=m[2][2]=m[3][3]=1;
    }
 
+   void Translate(double tx, double ty, double tz)
+   {
+      Matrix tmat;
+      Matrix mat1;
+
+      FillBytesBy4(tmat, 0, sizeof(Matrix) >> 2);
+      tmat.m[0][0]=tmat.m[1][1]=tmat.m[2][2]=tmat.m[3][3]=1;
+      tmat.m[3][0]=tx; tmat.m[3][1]=ty; tmat.m[3][2]=tz;
+      mat1.Multiply(this, tmat);
+      this = mat1;
+   }
+
+   void Scale(double sx, double sy, double sz)
+   {
+      Matrix smat;
+      Matrix mat1;
+      FillBytesBy4(smat, 0, sizeof(Matrix) >> 2);
+      smat.m[0][0]=sx; smat.m[1][1]=sy; smat.m[2][2]=sz; smat.m[3][3]=1;
+      mat1.Multiply(this, smat);
+      this = mat1;
+   }
+
    void Transpose(Matrix source)
    {
       int i,j;
@@ -151,7 +173,7 @@ public void glmsLoadMatrixf(float * i)
       i[2*4+0], i[2*4+1], i[2*4+2], i[2*4+3],
       i[3*4+0], i[3*4+1], i[3*4+2], i[3*4+3]
    };
-   memcpy(matrixStack[curStack][matrixIndex[curStack]].array, i, 16*sizeof(double));
+   memcpy(matrixStack[curStack][matrixIndex[curStack]].array, m, 16*sizeof(double));
    LoadCurMatrix();
 }
 
@@ -176,6 +198,29 @@ public void glmsOrtho( double l, double r, double b, double t, double n, double
    LoadCurMatrix();
 }
 
+public void glmsScaled( double a, double b, double c )
+{
+   Matrix m, r;
+
+   m.Identity();
+   m.Scale(a,b,c);
+   r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
+   matrixStack[curStack][matrixIndex[curStack]] = r;
+   LoadCurMatrix();
+}
+
+public void glmsTranslated( double a, double b, double c )
+{
+   Matrix m, r;
+
+   m.Identity();
+   m.Translate(a,b,c);
+   r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
+   matrixStack[curStack][matrixIndex[curStack]] = r;
+   LoadCurMatrix();
+}
+
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
 public void glmsFrustum( double l, double r, double b, double t, double n, double f )
 {
    nearPlane = n;
@@ -204,7 +249,6 @@ public void glmsFrustum( double l, double r, double b, double t, double n, doubl
    }
 }
 
-#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
 public void glmsRotated( double a, double b, double c, double d )
 {
    Quaternion q;
@@ -216,27 +260,6 @@ public void glmsRotated( double a, double b, double c, double d )
    matrixStack[curStack][matrixIndex[curStack]] = r;
    LoadCurMatrix();
 }
-public void glmsScaled( double a, double b, double c )
-{
-   Matrix m, r;
-
-   m.Identity();
-   m.Scale(a,b,c);
-   r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
-   matrixStack[curStack][matrixIndex[curStack]] = r;
-   LoadCurMatrix();
-}
-
-public void glmsTranslated( double a, double b, double c )
-{
-   Matrix m, r;
-
-   m.Identity();
-   m.Translate(a,b,c);
-   r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
-   matrixStack[curStack][matrixIndex[curStack]] = r;
-   LoadCurMatrix();
-}
 
 public void glmsMultMatrixd( double * i )
 {
index 688df00..e87a038 100644 (file)
@@ -95,6 +95,7 @@ void shader_texturing(bool on)
    glUniform1i(uTexturingOn, on);
 }
 
+#if !defined(ECERE_NO3D)
 public void shader_setMaterial(Material material, bool perVertexColor)
 {
    glUniform1i(uPerVertexColor, perVertexColor);
@@ -106,6 +107,7 @@ public void shader_setMaterial(Material material, bool perVertexColor)
    glUniform1f(uMatPower, material.power);
    glUniform1f(uMatOpacity, material.opacity);
 }
+#endif
 
 public void shader_setSimpleMaterial(ColorAlpha color)
 {
@@ -128,6 +130,7 @@ public void shader_setPerVertexColor(bool perVertexColor)
    glUniform1i(uPerVertexColor, perVertexColor);
 }
 
+#if !defined(ECERE_NO3D)
 void shader_setLight(Display display, uint id, Light light)
 {
    if(light != null)
@@ -237,6 +240,7 @@ void shader_setLight(Display display, uint id, Light light)
    else
       glUniform1i(uLightsOn[id], 0);
 }
+#endif
 
 bool loadShaders(const String vertexShaderFile, const String fragmentShaderFile)
 {
index ae24da2..85084e4 100644 (file)
@@ -6,14 +6,14 @@ import "OpenGLDisplayDriver"
 #include <math.h>
 #include <stdlib.h>
 
-#if defined(_GLES)
-   #define ES1_1
-#else
+#if !defined(_GLES)
    #define SHADERS
 #endif
 
 #if defined(__EMSCRIPTEN__)
-   #define ES2
+#if !defined(_GLES2)
+   #define _GLES2
+#endif
    #include <GLES2/gl2.h>
 #endif
 
index f950afb..458e502 100644 (file)
@@ -10,9 +10,7 @@ import "Color"
 #include <math.h>
 #include <stdlib.h>
 
-#if defined(_GLES)
-   #define ES1_1
-#else
+#if !defined(_GLES)
    #define SHADERS
 #endif
 
@@ -26,7 +24,9 @@ import "Color"
 #endif
 
 #if defined(__EMSCRIPTEN__)
-   #define ES2
+#if !defined(_GLES2)
+   #define _GLES2
+#endif
    #include <GLES2/gl2.h>
 #endif
 
index d485be9..96676ff 100644 (file)
@@ -3,9 +3,7 @@ import "instance"
 #include <stdio.h>
 #include <math.h>
 
-#if defined(_GLES)
-   #define ES1_1
-#else
+#if !defined(_GLES)
    #define SHADERS
 #endif
 
@@ -18,7 +16,9 @@ import "instance"
 #endif
 
 #if defined(__EMSCRIPTEN__)
-   #define ES2
+#if !defined(_GLES2)
+   #define _GLES2
+#endif
    #include <GLES2/gl2.h>
 #endif
 
index ae8686b..b241dd3 100644 (file)
             "TargetFileName" : "mandelbrot.html",
             "Libraries" : [
                "ecereStatic",
-               "z",
-               "jpeg",
-               "png",
-               "freetype"
+               "z"
             ],
             "LibraryDirs" : [
-               "../../../ecere/obj/emscripten.linux.emscripten"
+               "../../../ecere/obj/minEmscripten.linux.emscripten"
             ],
             "FastMath" : true
          }