1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OpenGL development.

This commit is contained in:
jules 2011-11-15 17:10:48 +00:00
parent 2a780902ba
commit 9bccfebea7
3 changed files with 1175 additions and 612 deletions

File diff suppressed because it is too large Load diff

View file

@ -75,13 +75,12 @@ public:
#ifndef DOXYGEN
class SavedState;
class GLState;
#endif
private:
ScopedPointer<GLState> glState;
RenderingHelpers::SavedStateStack<SavedState> stack;
GLuint previousFrameBufferTarget;
void initialise();
};
#endif // __JUCE_OPENGLGRAPHICSCONTEXT_JUCEHEADER__

View file

@ -49,22 +49,22 @@ void OpenGLTexture::create (const int w, const int h, const void* pixels, GLenum
jassert (isValidSize (w, h)); // Perhaps these dimensions must be a power-of-two?
if (width != w || height != h)
width = w;
height = h;
if (textureID == 0)
{
release();
width = w;
height = h;
glGenTextures (1, &textureID);
glBindTexture (GL_TEXTURE_2D, textureID);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
else
{
glBindTexture (GL_TEXTURE_2D, textureID);
}
glBindTexture (GL_TEXTURE_2D, textureID);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexImage2D (GL_TEXTURE_2D, 0, type == GL_ALPHA ? GL_ALPHA : GL_RGBA,