Browse Source

OpenGL development.

tags/2021-05-28
jules 14 years ago
parent
commit
9bccfebea7
3 changed files with 1156 additions and 593 deletions
  1. +1141
    -577
      modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
  2. +2
    -3
      modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h
  3. +13
    -13
      modules/juce_opengl/opengl/juce_OpenGLTexture.cpp

+ 1141
- 577
modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
File diff suppressed because it is too large
View File


+ 2
- 3
modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.h 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__

+ 13
- 13
modules/juce_opengl/opengl/juce_OpenGLTexture.cpp 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)
{
release();
width = w;
height = h;
width = w;
height = h;
if (textureID == 0)
{
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,


Loading…
Cancel
Save