mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -26,9 +26,11 @@
|
||||
// LOVE
|
||||
#include "graphics/Color.h"
|
||||
#include "graphics/Texture.h"
|
||||
#include "common/Matrix.h"
|
||||
|
||||
// C++
|
||||
#include <vector>
|
||||
#include <stack>
|
||||
|
||||
// The last argument to AttribPointer takes a buffer offset casted to a pointer.
|
||||
#define BUFFER_OFFSET(i) ((char *) NULL + (i))
|
||||
@@ -101,6 +103,36 @@ public:
|
||||
GLenum func;
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
std::vector<Matrix> transform;
|
||||
std::vector<Matrix> projection;
|
||||
} matrices;
|
||||
|
||||
class TempTransform
|
||||
{
|
||||
public:
|
||||
|
||||
TempTransform(OpenGL &gl)
|
||||
: gl(gl)
|
||||
{
|
||||
gl.pushTransform();
|
||||
}
|
||||
|
||||
~TempTransform()
|
||||
{
|
||||
gl.popTransform();
|
||||
}
|
||||
|
||||
Matrix &get()
|
||||
{
|
||||
return gl.getTransform();
|
||||
}
|
||||
|
||||
private:
|
||||
OpenGL ≷
|
||||
};
|
||||
|
||||
OpenGL();
|
||||
|
||||
/**
|
||||
@@ -121,6 +153,10 @@ public:
|
||||
**/
|
||||
void deInitContext();
|
||||
|
||||
void pushTransform();
|
||||
void popTransform();
|
||||
Matrix &getTransform();
|
||||
|
||||
/**
|
||||
* Set up necessary state (LOVE-provided shader uniforms, etc.) for drawing.
|
||||
* This *MUST* be called directly before OpenGL drawing functions.
|
||||
@@ -264,6 +300,7 @@ private:
|
||||
void initVendor();
|
||||
void initOpenGLFunctions();
|
||||
void initMaxValues();
|
||||
void initMatrices();
|
||||
void createDefaultTexture();
|
||||
|
||||
bool contextInitialized;
|
||||
@@ -296,6 +333,9 @@ private:
|
||||
// The last ID value used for pseudo-instancing.
|
||||
int lastPseudoInstanceID;
|
||||
|
||||
Matrix lastProjectionMatrix;
|
||||
Matrix lastTransformMatrix;
|
||||
|
||||
} state;
|
||||
|
||||
}; // OpenGL
|
||||
|
||||
Reference in New Issue
Block a user