Changed the love.graphics internal code to always use a default shader when none is set externally, and replaced the deprecated OpenGL vertex attribute code with the equivalent generic vertex attribute functions.

This will simplify the code and make it more maintainable when OpenGL ES 2+ support is added, compared to using the deprecated VA functions on desktop GL and the generic VA functions on GLES.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2014-08-26 03:24:42 -03:00
parent 2a1e1d01d3
commit 3a51f0ad08
16 changed files with 316 additions and 197 deletions
+11 -11
View File
@@ -48,6 +48,17 @@ namespace opengl
// no clashes with other GL libraries when linking, etc.
using namespace glad;
// Vertex attribute indices used in shaders by LOVE. The values map to OpenGL
// generic vertex attribute indices.
enum VertexAttribID
{
ATTRIB_POS = 0,
ATTRIB_TEXCOORD,
ATTRIB_COLOR,
ATTRIB_PSEUDO_INSTANCE_ID, // Instance ID used with pseudo-instancing.
ATTRIB_MAX_ENUM
};
/**
* Thin layer between OpenGL and the rest of the program.
* Internally shadows some OpenGL context state for improved efficiency and
@@ -71,17 +82,6 @@ public:
VENDOR_UNKNOWN
};
// Vertex attributes used in shaders by LOVE. The values map to OpenGL
// generic vertex attribute indices, when applicable.
// LOVE uses the old hard-coded attribute APIs for positions, colors, etc.
// (for now.)
enum VertexAttrib
{
// Instance ID when pseudo-instancing is used.
ATTRIB_PSEUDO_INSTANCE_ID = 1,
ATTRIB_MAX_ENUM
};
// A rectangle representing an OpenGL viewport or a scissor box.
struct Viewport
{