mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL: Add GLEW-inspired dynamic function loading
This commit is contained in:
parent
8a6a520026
commit
54423f6583
21 changed files with 23934 additions and 525 deletions
|
|
@ -4,6 +4,39 @@ JUCE breaking changes
|
|||
Develop
|
||||
=======
|
||||
|
||||
Change
|
||||
------
|
||||
Platform GL headers are no longer included in juce_opengl.h
|
||||
|
||||
Possible Issues
|
||||
---------------
|
||||
Projects depending on symbols declared in these headers may fail to build.
|
||||
|
||||
Workaround
|
||||
----------
|
||||
The old platform-supplied headers have been replaced with a new juce_gl.h
|
||||
header which is generated using the XML registry files supplied by Khronos.
|
||||
This custom header declares GL symbols in the juce::gl namespace. If your code
|
||||
only needs to be JUCE-compatible, you can explicitly qualify each name with
|
||||
`juce::gl::`. If you need your code to build with different extension-loader
|
||||
libraries (GLEW, GL3W etc.) you can make all GL symbols visible without
|
||||
additional qualification with `using namespace juce::gl`.
|
||||
|
||||
Rationale
|
||||
---------
|
||||
Using our own GL headers allows us to generate platform-independent headers
|
||||
which include symbols for all specified OpenGL versions and extensions. Note
|
||||
that although the function signatures exist, they may not resolve to a function
|
||||
at runtime. If your code uses commands from an extension or recent GL version,
|
||||
you should check each function pointer against `nullptr` before attempting to
|
||||
use it. To avoid repeatedly checking, you could query a subset of functions
|
||||
after calling gl::loadFunctions() and cache the results. Supplying custom GL
|
||||
headers also allows us to use C++ techniques (namespaces, references), making
|
||||
the headers safer than the platform-defined headers. Platform headers are
|
||||
generally written in C, and export a significant portion of their symbols as
|
||||
preprocessor definitions.
|
||||
|
||||
|
||||
Change
|
||||
------
|
||||
The functions `getComponentAsyncLayerBackedViewDisabled`
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ public:
|
|||
|
||||
void render() override
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
jassert (OpenGLHelpers::isContextActive());
|
||||
|
||||
auto desktopScale = (float) openGLContext.getRenderingScale();
|
||||
|
|
@ -117,11 +119,11 @@ public:
|
|||
if (uniforms->viewMatrix.get() != nullptr)
|
||||
uniforms->viewMatrix->setMatrix4 (getViewMatrix().mat, 1, false);
|
||||
|
||||
shape->draw (openGLContext, *attributes);
|
||||
shape->draw (*attributes);
|
||||
|
||||
// Reset the element buffers so child Components draw correctly
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -197,9 +199,9 @@ public:
|
|||
shader.reset (newShader.release());
|
||||
shader->use();
|
||||
|
||||
shape .reset (new Shape (openGLContext));
|
||||
attributes.reset (new Attributes (openGLContext, *shader));
|
||||
uniforms .reset (new Uniforms (openGLContext, *shader));
|
||||
shape .reset (new Shape());
|
||||
attributes.reset (new Attributes (*shader));
|
||||
uniforms .reset (new Uniforms (*shader));
|
||||
|
||||
statusText = "GLSL: v" + String (OpenGLShaderProgram::getLanguageVersion(), 2);
|
||||
}
|
||||
|
|
@ -224,57 +226,62 @@ private:
|
|||
// This class just manages the attributes that the shaders use.
|
||||
struct Attributes
|
||||
{
|
||||
Attributes (OpenGLContext& openGLContext, OpenGLShaderProgram& shaderProgram)
|
||||
explicit Attributes (OpenGLShaderProgram& shaderProgram)
|
||||
{
|
||||
position .reset (createAttribute (openGLContext, shaderProgram, "position"));
|
||||
normal .reset (createAttribute (openGLContext, shaderProgram, "normal"));
|
||||
sourceColour .reset (createAttribute (openGLContext, shaderProgram, "sourceColour"));
|
||||
textureCoordIn.reset (createAttribute (openGLContext, shaderProgram, "textureCoordIn"));
|
||||
position .reset (createAttribute (shaderProgram, "position"));
|
||||
normal .reset (createAttribute (shaderProgram, "normal"));
|
||||
sourceColour .reset (createAttribute (shaderProgram, "sourceColour"));
|
||||
textureCoordIn.reset (createAttribute (shaderProgram, "textureCoordIn"));
|
||||
}
|
||||
|
||||
void enable (OpenGLContext& glContext)
|
||||
void enable()
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (position.get() != nullptr)
|
||||
{
|
||||
glContext.extensions.glVertexAttribPointer (position->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), nullptr);
|
||||
glContext.extensions.glEnableVertexAttribArray (position->attributeID);
|
||||
glVertexAttribPointer (position->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), nullptr);
|
||||
glEnableVertexAttribArray (position->attributeID);
|
||||
}
|
||||
|
||||
if (normal.get() != nullptr)
|
||||
{
|
||||
glContext.extensions.glVertexAttribPointer (normal->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 3));
|
||||
glContext.extensions.glEnableVertexAttribArray (normal->attributeID);
|
||||
glVertexAttribPointer (normal->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 3));
|
||||
glEnableVertexAttribArray (normal->attributeID);
|
||||
}
|
||||
|
||||
if (sourceColour.get() != nullptr)
|
||||
{
|
||||
glContext.extensions.glVertexAttribPointer (sourceColour->attributeID, 4, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 6));
|
||||
glContext.extensions.glEnableVertexAttribArray (sourceColour->attributeID);
|
||||
glVertexAttribPointer (sourceColour->attributeID, 4, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 6));
|
||||
glEnableVertexAttribArray (sourceColour->attributeID);
|
||||
}
|
||||
|
||||
if (textureCoordIn.get() != nullptr)
|
||||
{
|
||||
glContext.extensions.glVertexAttribPointer (textureCoordIn->attributeID, 2, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 10));
|
||||
glContext.extensions.glEnableVertexAttribArray (textureCoordIn->attributeID);
|
||||
glVertexAttribPointer (textureCoordIn->attributeID, 2, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 10));
|
||||
glEnableVertexAttribArray (textureCoordIn->attributeID);
|
||||
}
|
||||
}
|
||||
|
||||
void disable (OpenGLContext& glContext)
|
||||
void disable()
|
||||
{
|
||||
if (position.get() != nullptr) glContext.extensions.glDisableVertexAttribArray (position->attributeID);
|
||||
if (normal.get() != nullptr) glContext.extensions.glDisableVertexAttribArray (normal->attributeID);
|
||||
if (sourceColour.get() != nullptr) glContext.extensions.glDisableVertexAttribArray (sourceColour->attributeID);
|
||||
if (textureCoordIn.get() != nullptr) glContext.extensions.glDisableVertexAttribArray (textureCoordIn->attributeID);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (position.get() != nullptr) glDisableVertexAttribArray (position->attributeID);
|
||||
if (normal.get() != nullptr) glDisableVertexAttribArray (normal->attributeID);
|
||||
if (sourceColour.get() != nullptr) glDisableVertexAttribArray (sourceColour->attributeID);
|
||||
if (textureCoordIn.get() != nullptr) glDisableVertexAttribArray (textureCoordIn->attributeID);
|
||||
}
|
||||
|
||||
std::unique_ptr<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn;
|
||||
|
||||
private:
|
||||
static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext,
|
||||
OpenGLShaderProgram& shader,
|
||||
static OpenGLShaderProgram::Attribute* createAttribute (OpenGLShaderProgram& shader,
|
||||
const char* attributeName)
|
||||
{
|
||||
if (openGLContext.extensions.glGetAttribLocation (shader.getProgramID(), attributeName) < 0)
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (glGetAttribLocation (shader.getProgramID(), attributeName) < 0)
|
||||
return nullptr;
|
||||
|
||||
return new OpenGLShaderProgram::Attribute (shader, attributeName);
|
||||
|
|
@ -285,20 +292,21 @@ private:
|
|||
// This class just manages the uniform values that the demo shaders use.
|
||||
struct Uniforms
|
||||
{
|
||||
Uniforms (OpenGLContext& openGLContext, OpenGLShaderProgram& shaderProgram)
|
||||
explicit Uniforms (OpenGLShaderProgram& shaderProgram)
|
||||
{
|
||||
projectionMatrix.reset (createUniform (openGLContext, shaderProgram, "projectionMatrix"));
|
||||
viewMatrix .reset (createUniform (openGLContext, shaderProgram, "viewMatrix"));
|
||||
projectionMatrix.reset (createUniform (shaderProgram, "projectionMatrix"));
|
||||
viewMatrix .reset (createUniform (shaderProgram, "viewMatrix"));
|
||||
}
|
||||
|
||||
std::unique_ptr<OpenGLShaderProgram::Uniform> projectionMatrix, viewMatrix;
|
||||
|
||||
private:
|
||||
static OpenGLShaderProgram::Uniform* createUniform (OpenGLContext& openGLContext,
|
||||
OpenGLShaderProgram& shaderProgram,
|
||||
static OpenGLShaderProgram::Uniform* createUniform (OpenGLShaderProgram& shaderProgram,
|
||||
const char* uniformName)
|
||||
{
|
||||
if (openGLContext.extensions.glGetUniformLocation (shaderProgram.getProgramID(), uniformName) < 0)
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (glGetUniformLocation (shaderProgram.getProgramID(), uniformName) < 0)
|
||||
return nullptr;
|
||||
|
||||
return new OpenGLShaderProgram::Uniform (shaderProgram, uniformName);
|
||||
|
|
@ -311,64 +319,71 @@ private:
|
|||
*/
|
||||
struct Shape
|
||||
{
|
||||
Shape (OpenGLContext& glContext)
|
||||
Shape()
|
||||
{
|
||||
if (shapeFile.load (loadEntireAssetIntoString ("teapot.obj")).wasOk())
|
||||
for (auto* shapeVertices : shapeFile.shapes)
|
||||
vertexBuffers.add (new VertexBuffer (glContext, *shapeVertices));
|
||||
vertexBuffers.add (new VertexBuffer (*shapeVertices));
|
||||
}
|
||||
|
||||
void draw (OpenGLContext& glContext, Attributes& glAttributes)
|
||||
void draw (Attributes& glAttributes)
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
for (auto* vertexBuffer : vertexBuffers)
|
||||
{
|
||||
vertexBuffer->bind();
|
||||
|
||||
glAttributes.enable (glContext);
|
||||
glAttributes.enable();
|
||||
glDrawElements (GL_TRIANGLES, vertexBuffer->numIndices, GL_UNSIGNED_INT, nullptr);
|
||||
glAttributes.disable (glContext);
|
||||
glAttributes.disable();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
struct VertexBuffer
|
||||
{
|
||||
VertexBuffer (OpenGLContext& context, WavefrontObjFile::Shape& aShape) : openGLContext (context)
|
||||
explicit VertexBuffer (WavefrontObjFile::Shape& aShape)
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
numIndices = aShape.mesh.indices.size();
|
||||
|
||||
openGLContext.extensions.glGenBuffers (1, &vertexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
glGenBuffers (1, &vertexBuffer);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
|
||||
Array<Vertex> vertices;
|
||||
createVertexListFromMesh (aShape.mesh, vertices, Colours::green);
|
||||
|
||||
openGLContext.extensions.glBufferData (GL_ARRAY_BUFFER,
|
||||
static_cast<GLsizeiptr> (static_cast<size_t> (vertices.size()) * sizeof (Vertex)),
|
||||
vertices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
glBufferData (GL_ARRAY_BUFFER,
|
||||
static_cast<GLsizeiptr> (static_cast<size_t> (vertices.size()) * sizeof (Vertex)),
|
||||
vertices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
|
||||
openGLContext.extensions.glGenBuffers (1, &indexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
openGLContext.extensions.glBufferData (GL_ELEMENT_ARRAY_BUFFER,
|
||||
static_cast<GLsizeiptr> (static_cast<size_t> (numIndices) * sizeof (juce::uint32)),
|
||||
aShape.mesh.indices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
glGenBuffers (1, &indexBuffer);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
glBufferData (GL_ELEMENT_ARRAY_BUFFER,
|
||||
static_cast<GLsizeiptr> (static_cast<size_t> (numIndices) * sizeof (juce::uint32)),
|
||||
aShape.mesh.indices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
~VertexBuffer()
|
||||
{
|
||||
openGLContext.extensions.glDeleteBuffers (1, &vertexBuffer);
|
||||
openGLContext.extensions.glDeleteBuffers (1, &indexBuffer);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
glDeleteBuffers (1, &vertexBuffer);
|
||||
glDeleteBuffers (1, &indexBuffer);
|
||||
}
|
||||
|
||||
void bind()
|
||||
{
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
}
|
||||
|
||||
GLuint vertexBuffer, indexBuffer;
|
||||
int numIndices;
|
||||
OpenGLContext& openGLContext;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VertexBuffer)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,57 +69,62 @@ struct OpenGLUtils
|
|||
// This class just manages the attributes that the demo shaders use.
|
||||
struct Attributes
|
||||
{
|
||||
Attributes (OpenGLContext& openGLContext, OpenGLShaderProgram& shader)
|
||||
explicit Attributes (OpenGLShaderProgram& shader)
|
||||
{
|
||||
position .reset (createAttribute (openGLContext, shader, "position"));
|
||||
normal .reset (createAttribute (openGLContext, shader, "normal"));
|
||||
sourceColour .reset (createAttribute (openGLContext, shader, "sourceColour"));
|
||||
textureCoordIn.reset (createAttribute (openGLContext, shader, "textureCoordIn"));
|
||||
position .reset (createAttribute (shader, "position"));
|
||||
normal .reset (createAttribute (shader, "normal"));
|
||||
sourceColour .reset (createAttribute (shader, "sourceColour"));
|
||||
textureCoordIn.reset (createAttribute (shader, "textureCoordIn"));
|
||||
}
|
||||
|
||||
void enable (OpenGLContext& openGLContext)
|
||||
void enable()
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (position.get() != nullptr)
|
||||
{
|
||||
openGLContext.extensions.glVertexAttribPointer (position->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), nullptr);
|
||||
openGLContext.extensions.glEnableVertexAttribArray (position->attributeID);
|
||||
glVertexAttribPointer (position->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), nullptr);
|
||||
glEnableVertexAttribArray (position->attributeID);
|
||||
}
|
||||
|
||||
if (normal.get() != nullptr)
|
||||
{
|
||||
openGLContext.extensions.glVertexAttribPointer (normal->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 3));
|
||||
openGLContext.extensions.glEnableVertexAttribArray (normal->attributeID);
|
||||
glVertexAttribPointer (normal->attributeID, 3, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 3));
|
||||
glEnableVertexAttribArray (normal->attributeID);
|
||||
}
|
||||
|
||||
if (sourceColour.get() != nullptr)
|
||||
{
|
||||
openGLContext.extensions.glVertexAttribPointer (sourceColour->attributeID, 4, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 6));
|
||||
openGLContext.extensions.glEnableVertexAttribArray (sourceColour->attributeID);
|
||||
glVertexAttribPointer (sourceColour->attributeID, 4, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 6));
|
||||
glEnableVertexAttribArray (sourceColour->attributeID);
|
||||
}
|
||||
|
||||
if (textureCoordIn.get() != nullptr)
|
||||
{
|
||||
openGLContext.extensions.glVertexAttribPointer (textureCoordIn->attributeID, 2, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 10));
|
||||
openGLContext.extensions.glEnableVertexAttribArray (textureCoordIn->attributeID);
|
||||
glVertexAttribPointer (textureCoordIn->attributeID, 2, GL_FLOAT, GL_FALSE, sizeof (Vertex), (GLvoid*) (sizeof (float) * 10));
|
||||
glEnableVertexAttribArray (textureCoordIn->attributeID);
|
||||
}
|
||||
}
|
||||
|
||||
void disable (OpenGLContext& openGLContext)
|
||||
void disable()
|
||||
{
|
||||
if (position.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (position->attributeID);
|
||||
if (normal.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (normal->attributeID);
|
||||
if (sourceColour.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (sourceColour->attributeID);
|
||||
if (textureCoordIn.get() != nullptr) openGLContext.extensions.glDisableVertexAttribArray (textureCoordIn->attributeID);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (position.get() != nullptr) glDisableVertexAttribArray (position->attributeID);
|
||||
if (normal.get() != nullptr) glDisableVertexAttribArray (normal->attributeID);
|
||||
if (sourceColour.get() != nullptr) glDisableVertexAttribArray (sourceColour->attributeID);
|
||||
if (textureCoordIn.get() != nullptr) glDisableVertexAttribArray (textureCoordIn->attributeID);
|
||||
}
|
||||
|
||||
std::unique_ptr<OpenGLShaderProgram::Attribute> position, normal, sourceColour, textureCoordIn;
|
||||
|
||||
private:
|
||||
static OpenGLShaderProgram::Attribute* createAttribute (OpenGLContext& openGLContext,
|
||||
OpenGLShaderProgram& shader,
|
||||
static OpenGLShaderProgram::Attribute* createAttribute (OpenGLShaderProgram& shader,
|
||||
const char* attributeName)
|
||||
{
|
||||
if (openGLContext.extensions.glGetAttribLocation (shader.getProgramID(), attributeName) < 0)
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (glGetAttribLocation (shader.getProgramID(), attributeName) < 0)
|
||||
return nullptr;
|
||||
|
||||
return new OpenGLShaderProgram::Attribute (shader, attributeName);
|
||||
|
|
@ -130,23 +135,24 @@ struct OpenGLUtils
|
|||
// This class just manages the uniform values that the demo shaders use.
|
||||
struct Uniforms
|
||||
{
|
||||
Uniforms (OpenGLContext& openGLContext, OpenGLShaderProgram& shader)
|
||||
explicit Uniforms (OpenGLShaderProgram& shader)
|
||||
{
|
||||
projectionMatrix.reset (createUniform (openGLContext, shader, "projectionMatrix"));
|
||||
viewMatrix .reset (createUniform (openGLContext, shader, "viewMatrix"));
|
||||
texture .reset (createUniform (openGLContext, shader, "demoTexture"));
|
||||
lightPosition .reset (createUniform (openGLContext, shader, "lightPosition"));
|
||||
bouncingNumber .reset (createUniform (openGLContext, shader, "bouncingNumber"));
|
||||
projectionMatrix.reset (createUniform (shader, "projectionMatrix"));
|
||||
viewMatrix .reset (createUniform (shader, "viewMatrix"));
|
||||
texture .reset (createUniform (shader, "demoTexture"));
|
||||
lightPosition .reset (createUniform (shader, "lightPosition"));
|
||||
bouncingNumber .reset (createUniform (shader, "bouncingNumber"));
|
||||
}
|
||||
|
||||
std::unique_ptr<OpenGLShaderProgram::Uniform> projectionMatrix, viewMatrix, texture, lightPosition, bouncingNumber;
|
||||
|
||||
private:
|
||||
static OpenGLShaderProgram::Uniform* createUniform (OpenGLContext& openGLContext,
|
||||
OpenGLShaderProgram& shader,
|
||||
static OpenGLShaderProgram::Uniform* createUniform (OpenGLShaderProgram& shader,
|
||||
const char* uniformName)
|
||||
{
|
||||
if (openGLContext.extensions.glGetUniformLocation (shader.getProgramID(), uniformName) < 0)
|
||||
using namespace ::juce::gl;
|
||||
|
||||
if (glGetUniformLocation (shader.getProgramID(), uniformName) < 0)
|
||||
return nullptr;
|
||||
|
||||
return new OpenGLShaderProgram::Uniform (shader, uniformName);
|
||||
|
|
@ -159,62 +165,69 @@ struct OpenGLUtils
|
|||
*/
|
||||
struct Shape
|
||||
{
|
||||
Shape (OpenGLContext& openGLContext)
|
||||
Shape()
|
||||
{
|
||||
if (shapeFile.load (loadEntireAssetIntoString ("teapot.obj")).wasOk())
|
||||
for (auto* s : shapeFile.shapes)
|
||||
vertexBuffers.add (new VertexBuffer (openGLContext, *s));
|
||||
vertexBuffers.add (new VertexBuffer (*s));
|
||||
}
|
||||
|
||||
void draw (OpenGLContext& openGLContext, Attributes& attributes)
|
||||
void draw (Attributes& attributes)
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
for (auto* vertexBuffer : vertexBuffers)
|
||||
{
|
||||
vertexBuffer->bind();
|
||||
|
||||
attributes.enable (openGLContext);
|
||||
attributes.enable();
|
||||
glDrawElements (GL_TRIANGLES, vertexBuffer->numIndices, GL_UNSIGNED_INT, nullptr);
|
||||
attributes.disable (openGLContext);
|
||||
attributes.disable();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
struct VertexBuffer
|
||||
{
|
||||
VertexBuffer (OpenGLContext& context, WavefrontObjFile::Shape& shape) : openGLContext (context)
|
||||
explicit VertexBuffer (WavefrontObjFile::Shape& shape)
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
numIndices = shape.mesh.indices.size();
|
||||
|
||||
openGLContext.extensions.glGenBuffers (1, &vertexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
glGenBuffers (1, &vertexBuffer);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
|
||||
Array<Vertex> vertices;
|
||||
createVertexListFromMesh (shape.mesh, vertices, Colours::green);
|
||||
|
||||
openGLContext.extensions.glBufferData (GL_ARRAY_BUFFER, vertices.size() * (int) sizeof (Vertex),
|
||||
vertices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
glBufferData (GL_ARRAY_BUFFER, vertices.size() * (int) sizeof (Vertex),
|
||||
vertices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
|
||||
openGLContext.extensions.glGenBuffers (1, &indexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
openGLContext.extensions.glBufferData (GL_ELEMENT_ARRAY_BUFFER, numIndices * (int) sizeof (juce::uint32),
|
||||
glGenBuffers (1, &indexBuffer);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
glBufferData (GL_ELEMENT_ARRAY_BUFFER, numIndices * (int) sizeof (juce::uint32),
|
||||
shape.mesh.indices.getRawDataPointer(), GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
~VertexBuffer()
|
||||
{
|
||||
openGLContext.extensions.glDeleteBuffers (1, &vertexBuffer);
|
||||
openGLContext.extensions.glDeleteBuffers (1, &indexBuffer);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
glDeleteBuffers (1, &vertexBuffer);
|
||||
glDeleteBuffers (1, &indexBuffer);
|
||||
}
|
||||
|
||||
void bind()
|
||||
{
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
using namespace ::juce::gl;
|
||||
|
||||
glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
|
||||
}
|
||||
|
||||
GLuint vertexBuffer, indexBuffer;
|
||||
int numIndices;
|
||||
OpenGLContext& openGLContext;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VertexBuffer)
|
||||
};
|
||||
|
|
@ -801,6 +814,8 @@ public:
|
|||
// to do your GL rendering.
|
||||
void renderOpenGL() override
|
||||
{
|
||||
using namespace ::juce::gl;
|
||||
|
||||
jassert (OpenGLHelpers::isContextActive());
|
||||
|
||||
auto desktopScale = (float) openGLContext.getRenderingScale();
|
||||
|
|
@ -827,7 +842,7 @@ public:
|
|||
glDepthFunc (GL_LESS);
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
openGLContext.extensions.glActiveTexture (GL_TEXTURE0);
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
glViewport (0, 0, roundToInt (desktopScale * (float) getWidth()), roundToInt (desktopScale * (float) getHeight()));
|
||||
|
|
@ -854,11 +869,11 @@ public:
|
|||
if (uniforms->bouncingNumber.get() != nullptr)
|
||||
uniforms->bouncingNumber->set (bouncingNumber.getValue());
|
||||
|
||||
shape->draw (openGLContext, *attributes);
|
||||
shape->draw (*attributes);
|
||||
|
||||
// Reset the element buffers so child Components draw correctly
|
||||
openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
|
||||
if (! controlsOverlay->isMouseButtonDown())
|
||||
rotation += (float) rotationSpeed;
|
||||
|
|
@ -1236,9 +1251,9 @@ private:
|
|||
shader.reset (newShader.release());
|
||||
shader->use();
|
||||
|
||||
shape .reset (new OpenGLUtils::Shape (openGLContext));
|
||||
attributes.reset (new OpenGLUtils::Attributes (openGLContext, *shader));
|
||||
uniforms .reset (new OpenGLUtils::Uniforms (openGLContext, *shader));
|
||||
shape .reset (new OpenGLUtils::Shape ());
|
||||
attributes.reset (new OpenGLUtils::Attributes (*shader));
|
||||
uniforms .reset (new OpenGLUtils::Uniforms (*shader));
|
||||
|
||||
statusText = "GLSL: v" + String (OpenGLShaderProgram::getLanguageVersion(), 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,20 @@
|
|||
|
||||
#include "juce_opengl.h"
|
||||
|
||||
#define JUCE_STATIC_LINK_GL_VERSION_1_0 1
|
||||
#define JUCE_STATIC_LINK_GL_VERSION_1_1 1
|
||||
|
||||
#define JUCE_STATIC_LINK_GL_ES_VERSION_2_0 1
|
||||
#if !JUCE_ANDROID || JUCE_ANDROID_GL_ES_VERSION_3_0
|
||||
#define JUCE_STATIC_LINK_GL_ES_VERSION_3_0 1
|
||||
#endif
|
||||
|
||||
#if JUCE_OPENGL_ES
|
||||
#include "opengl/juce_gles2.cpp"
|
||||
#else
|
||||
#include "opengl/juce_gl.cpp"
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_IOS
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
|
@ -69,63 +83,27 @@
|
|||
|
||||
//==============================================================================
|
||||
#elif JUCE_ANDROID
|
||||
#ifndef GL_GLEXT_PROTOTYPES
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
#if JUCE_ANDROID_GL_ES_VERSION_3_0
|
||||
#include <GLES3/gl3.h>
|
||||
|
||||
// workaround for a bug in SDK 18 and 19
|
||||
// see: https://stackoverflow.com/questions/31003863/gles-3-0-including-gl2ext-h
|
||||
#define __gl2_h_
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#include <GLES2/gl2.h>
|
||||
#endif
|
||||
#include <android/native_window.h>
|
||||
#include <android/native_window_jni.h>
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
namespace juce
|
||||
{
|
||||
|
||||
using namespace ::juce::gl;
|
||||
|
||||
void OpenGLExtensionFunctions::initialise()
|
||||
{
|
||||
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
|
||||
#define JUCE_INIT_GL_FUNCTION(name, returnType, params, callparams) \
|
||||
name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name);
|
||||
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_INIT_GL_FUNCTION)
|
||||
#undef JUCE_INIT_GL_FUNCTION
|
||||
|
||||
#define JUCE_INIT_GL_FUNCTION(name, returnType, params, callparams) \
|
||||
name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name); \
|
||||
if (name == nullptr) \
|
||||
name = (type_ ## name) OpenGLHelpers::getExtensionFunction (JUCE_STRINGIFY (name ## EXT));
|
||||
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_INIT_GL_FUNCTION)
|
||||
#if JUCE_OPENGL3
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_INIT_GL_FUNCTION)
|
||||
#endif
|
||||
|
||||
#undef JUCE_INIT_GL_FUNCTION
|
||||
#endif
|
||||
gl::loadFunctions();
|
||||
}
|
||||
|
||||
#if JUCE_OPENGL_ES
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) \
|
||||
returnType OpenGLExtensionFunctions::name params noexcept { return ::name callparams; }
|
||||
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#if JUCE_OPENGL3
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#endif
|
||||
|
||||
#undef JUCE_DECLARE_GL_FUNCTION
|
||||
#endif
|
||||
|
||||
#undef JUCE_GL_EXTENSION_FUNCTIONS
|
||||
#define X(name) decltype (::juce::gl::name)& OpenGLExtensionFunctions::name = ::juce::gl::name;
|
||||
JUCE_GL_BASE_FUNCTIONS
|
||||
JUCE_GL_EXTENSION_FUNCTIONS
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS
|
||||
#undef X
|
||||
|
||||
#if JUCE_DEBUG && ! defined (JUCE_CHECK_OPENGL_ERROR)
|
||||
static const char* getGLErrorMessage (const GLenum e) noexcept
|
||||
|
|
@ -271,6 +249,7 @@ private:
|
|||
#endif
|
||||
|
||||
#elif JUCE_WINDOWS
|
||||
#include "opengl/juce_wgl.h"
|
||||
#include "native/juce_OpenGL_win32.h"
|
||||
|
||||
#elif JUCE_LINUX || JUCE_BSD
|
||||
|
|
|
|||
|
|
@ -55,82 +55,28 @@
|
|||
#pragma once
|
||||
#define JUCE_OPENGL_H_INCLUDED
|
||||
|
||||
#include <juce_gui_extra/juce_gui_extra.h>
|
||||
#include <juce_core/system/juce_TargetPlatform.h>
|
||||
|
||||
#undef JUCE_OPENGL
|
||||
#define JUCE_OPENGL 1
|
||||
|
||||
#if JUCE_IOS || JUCE_ANDROID
|
||||
#define JUCE_OPENGL_ES 1
|
||||
#include "opengl/juce_gles2.h"
|
||||
#else
|
||||
#include "opengl/juce_gl.h"
|
||||
#endif
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY __stdcall
|
||||
#define CLEAR_TEMP_APIENTRY 1
|
||||
#endif
|
||||
#ifndef WINGDIAPI
|
||||
#define WINGDIAPI __declspec(dllimport)
|
||||
#define CLEAR_TEMP_WINGDIAPI 1
|
||||
#endif
|
||||
|
||||
#if JUCE_MINGW
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#include <gl/GL.h>
|
||||
#endif
|
||||
|
||||
#ifdef CLEAR_TEMP_WINGDIAPI
|
||||
#undef WINGDIAPI
|
||||
#undef CLEAR_TEMP_WINGDIAPI
|
||||
#endif
|
||||
#ifdef CLEAR_TEMP_APIENTRY
|
||||
#undef APIENTRY
|
||||
#undef CLEAR_TEMP_APIENTRY
|
||||
#endif
|
||||
#elif JUCE_LINUX || JUCE_BSD
|
||||
#include <GL/gl.h>
|
||||
#undef KeyPress
|
||||
#elif JUCE_IOS
|
||||
#if defined (__IPHONE_12_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_12_0
|
||||
#define GLES_SILENCE_DEPRECATION 1
|
||||
#endif
|
||||
#include <OpenGLES/ES3/gl.h>
|
||||
#elif JUCE_MAC
|
||||
#define JUCE_OPENGL3 1
|
||||
#if defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
|
||||
#define GL_SILENCE_DEPRECATION 1
|
||||
#endif
|
||||
#include <OpenGL/gl3.h>
|
||||
#include <OpenGL/gl3ext.h>
|
||||
#elif JUCE_ANDROID
|
||||
#include <android/native_window.h>
|
||||
#include <android/native_window_jni.h>
|
||||
#if JUCE_ANDROID_GL_ES_VERSION_3_0
|
||||
#define JUCE_OPENGL3 1
|
||||
#include <GLES3/gl3.h>
|
||||
#else
|
||||
#include <GLES2/gl2.h>
|
||||
#endif
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
#if GL_ES_VERSION_3_0
|
||||
#define JUCE_OPENGL3 1
|
||||
#endif
|
||||
#include <juce_gui_extra/juce_gui_extra.h>
|
||||
|
||||
//==============================================================================
|
||||
/** This macro is a helper for use in GLSL shader code which needs to compile on both OpenGL 2.1 and OpenGL 3.0.
|
||||
It's mandatory in OpenGL 3.0 to specify the GLSL version.
|
||||
*/
|
||||
#if JUCE_OPENGL3
|
||||
#if JUCE_OPENGL_ES
|
||||
#define JUCE_GLSL_VERSION "#version 300 es"
|
||||
#else
|
||||
#define JUCE_GLSL_VERSION "#version 150"
|
||||
#endif
|
||||
#if JUCE_OPENGL_ES
|
||||
#define JUCE_GLSL_VERSION "#version 300 es"
|
||||
#else
|
||||
#define JUCE_GLSL_VERSION ""
|
||||
#define JUCE_GLSL_VERSION "#version 150"
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -170,7 +116,6 @@ namespace juce
|
|||
#include "geometry/juce_Matrix3D.h"
|
||||
#include "geometry/juce_Quaternion.h"
|
||||
#include "geometry/juce_Draggable3DOrientation.h"
|
||||
#include "native/juce_MissingGLDefinitions.h"
|
||||
#include "opengl/juce_OpenGLHelpers.h"
|
||||
#include "opengl/juce_OpenGLPixelFormat.h"
|
||||
#include "native/juce_OpenGLExtensions.h"
|
||||
|
|
|
|||
|
|
@ -1,170 +0,0 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
/** These are important openGL values that aren't defined by default
|
||||
by the GL headers on various platforms.
|
||||
*/
|
||||
enum MissingOpenGLDefinitions
|
||||
{
|
||||
#ifndef GL_CLAMP_TO_EDGE
|
||||
GL_CLAMP_TO_EDGE = 0x812f,
|
||||
#endif
|
||||
|
||||
#ifndef GL_NUM_EXTENSIONS
|
||||
GL_NUM_EXTENSIONS = 0x821d,
|
||||
#endif
|
||||
|
||||
#ifndef GL_BGRA_EXT
|
||||
GL_BGRA_EXT = 0x80e1,
|
||||
#endif
|
||||
|
||||
#ifndef GL_DEPTH24_STENCIL8
|
||||
GL_DEPTH24_STENCIL8 = 0x88F0,
|
||||
#endif
|
||||
|
||||
#ifndef GL_RGBA8
|
||||
GL_RGBA8 = GL_RGBA,
|
||||
#endif
|
||||
|
||||
#ifndef GL_RGBA32F
|
||||
GL_RGBA32F = 0x8814,
|
||||
#endif
|
||||
|
||||
#ifndef GL_COLOR_ATTACHMENT0
|
||||
GL_COLOR_ATTACHMENT0 = 0x8CE0,
|
||||
#endif
|
||||
|
||||
#ifndef GL_DEPTH_ATTACHMENT
|
||||
GL_DEPTH_ATTACHMENT = 0x8D00,
|
||||
#endif
|
||||
|
||||
#ifndef GL_FRAMEBUFFER
|
||||
GL_FRAMEBUFFER = 0x8D40,
|
||||
#endif
|
||||
|
||||
#ifndef GL_FRAMEBUFFER_BINDING
|
||||
GL_FRAMEBUFFER_BINDING = 0x8CA6,
|
||||
#endif
|
||||
|
||||
#ifndef GL_FRAMEBUFFER_COMPLETE
|
||||
GL_FRAMEBUFFER_COMPLETE = 0x8CD5,
|
||||
#endif
|
||||
|
||||
#ifndef GL_RENDERBUFFER
|
||||
GL_RENDERBUFFER = 0x8D41,
|
||||
#endif
|
||||
|
||||
#ifndef GL_RENDERBUFFER_DEPTH_SIZE
|
||||
GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54,
|
||||
#endif
|
||||
|
||||
#ifndef GL_STENCIL_ATTACHMENT
|
||||
GL_STENCIL_ATTACHMENT = 0x8D20,
|
||||
#endif
|
||||
|
||||
#ifndef GL_MULTISAMPLE
|
||||
GL_MULTISAMPLE = 0x809D,
|
||||
#endif
|
||||
|
||||
#ifndef GL_MAX_ELEMENTS_INDICES
|
||||
GL_MAX_ELEMENTS_INDICES = 0x80E9,
|
||||
#endif
|
||||
|
||||
#ifndef GL_POINT_SPRITE
|
||||
GL_POINT_SPRITE = 0x8861,
|
||||
#endif
|
||||
|
||||
#if JUCE_WINDOWS && ! defined (GL_TEXTURE0)
|
||||
GL_OPERAND0_RGB = 0x8590,
|
||||
GL_OPERAND1_RGB = 0x8591,
|
||||
GL_OPERAND0_ALPHA = 0x8598,
|
||||
GL_OPERAND1_ALPHA = 0x8599,
|
||||
GL_SRC0_RGB = 0x8580,
|
||||
GL_SRC1_RGB = 0x8581,
|
||||
GL_SRC0_ALPHA = 0x8588,
|
||||
GL_SRC1_ALPHA = 0x8589,
|
||||
GL_TEXTURE0 = 0x84C0,
|
||||
GL_TEXTURE1 = 0x84C1,
|
||||
GL_TEXTURE2 = 0x84C2,
|
||||
GL_COMBINE = 0x8570,
|
||||
GL_COMBINE_RGB = 0x8571,
|
||||
GL_COMBINE_ALPHA = 0x8572,
|
||||
GL_PREVIOUS = 0x8578,
|
||||
GL_COMPILE_STATUS = 0x8B81,
|
||||
GL_LINK_STATUS = 0x8B82,
|
||||
GL_SHADING_LANGUAGE_VERSION = 0x8B8C,
|
||||
GL_FRAGMENT_SHADER = 0x8B30,
|
||||
GL_VERTEX_SHADER = 0x8B31,
|
||||
GL_ARRAY_BUFFER = 0x8892,
|
||||
GL_ELEMENT_ARRAY_BUFFER = 0x8893,
|
||||
GL_STATIC_DRAW = 0x88E4,
|
||||
GL_DYNAMIC_DRAW = 0x88E8,
|
||||
GL_STREAM_DRAW = 0x88E0,
|
||||
|
||||
WGL_NUMBER_PIXEL_FORMATS_ARB = 0x2000,
|
||||
WGL_DRAW_TO_WINDOW_ARB = 0x2001,
|
||||
WGL_ACCELERATION_ARB = 0x2003,
|
||||
WGL_SWAP_METHOD_ARB = 0x2007,
|
||||
WGL_SUPPORT_OPENGL_ARB = 0x2010,
|
||||
WGL_PIXEL_TYPE_ARB = 0x2013,
|
||||
WGL_DOUBLE_BUFFER_ARB = 0x2011,
|
||||
WGL_COLOR_BITS_ARB = 0x2014,
|
||||
WGL_RED_BITS_ARB = 0x2015,
|
||||
WGL_GREEN_BITS_ARB = 0x2017,
|
||||
WGL_BLUE_BITS_ARB = 0x2019,
|
||||
WGL_ALPHA_BITS_ARB = 0x201B,
|
||||
WGL_DEPTH_BITS_ARB = 0x2022,
|
||||
WGL_STENCIL_BITS_ARB = 0x2023,
|
||||
WGL_FULL_ACCELERATION_ARB = 0x2027,
|
||||
WGL_ACCUM_RED_BITS_ARB = 0x201E,
|
||||
WGL_ACCUM_GREEN_BITS_ARB = 0x201F,
|
||||
WGL_ACCUM_BLUE_BITS_ARB = 0x2020,
|
||||
WGL_ACCUM_ALPHA_BITS_ARB = 0x2021,
|
||||
WGL_STEREO_ARB = 0x2012,
|
||||
WGL_SAMPLE_BUFFERS_ARB = 0x2041,
|
||||
WGL_SAMPLES_ARB = 0x2042,
|
||||
WGL_TYPE_RGBA_ARB = 0x202B,
|
||||
WGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091,
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB = 0x2092,
|
||||
WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126,
|
||||
#endif
|
||||
|
||||
#if JUCE_ANDROID
|
||||
JUCE_RGBA_FORMAT = GL_RGBA
|
||||
#else
|
||||
JUCE_RGBA_FORMAT = GL_BGRA_EXT
|
||||
#endif
|
||||
};
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
typedef char GLchar;
|
||||
typedef pointer_sized_int GLsizeiptr;
|
||||
typedef pointer_sized_int GLintptr;
|
||||
#endif
|
||||
|
||||
} // namespace juce
|
||||
|
|
@ -29,79 +29,90 @@ namespace juce
|
|||
/** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
|
||||
@see OpenGLExtensionFunctions
|
||||
*/
|
||||
#define JUCE_GL_BASE_FUNCTIONS(USE_FUNCTION) \
|
||||
USE_FUNCTION (glActiveTexture, void, (GLenum p1), (p1))\
|
||||
USE_FUNCTION (glBindBuffer, void, (GLenum p1, GLuint p2), (p1, p2))\
|
||||
USE_FUNCTION (glDeleteBuffers, void, (GLsizei p1, const GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glGenBuffers, void, (GLsizei p1, GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glBufferData, void, (GLenum p1, GLsizeiptr p2, const GLvoid* p3, GLenum p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glBufferSubData, void, (GLenum p1, GLintptr p2, GLsizeiptr p3, const GLvoid* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glCreateProgram, GLuint, (), ())\
|
||||
USE_FUNCTION (glDeleteProgram, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glCreateShader, GLuint, (GLenum p1), (p1))\
|
||||
USE_FUNCTION (glDeleteShader, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glShaderSource, void, (GLuint p1, GLsizei p2, const GLchar** p3, const GLint* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glCompileShader, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glAttachShader, void, (GLuint p1, GLuint p2), (p1, p2))\
|
||||
USE_FUNCTION (glLinkProgram, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glUseProgram, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glGetShaderiv, void, (GLuint p1, GLenum p2, GLint* p3), (p1, p2, p3))\
|
||||
USE_FUNCTION (glGetShaderInfoLog, void, (GLuint p1, GLsizei p2, GLsizei* p3, GLchar* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glGetProgramInfoLog, void, (GLuint p1, GLsizei p2, GLsizei* p3, GLchar* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glGetProgramiv, void, (GLuint p1, GLenum p2, GLint* p3), (p1, p2, p3))\
|
||||
USE_FUNCTION (glGetUniformLocation, GLint, (GLuint p1, const GLchar* p2), (p1, p2))\
|
||||
USE_FUNCTION (glGetAttribLocation, GLint, (GLuint p1, const GLchar* p2), (p1, p2))\
|
||||
USE_FUNCTION (glVertexAttribPointer, void, (GLuint p1, GLint p2, GLenum p3, GLboolean p4, GLsizei p5, const GLvoid* p6), (p1, p2, p3, p4, p5, p6))\
|
||||
USE_FUNCTION (glEnableVertexAttribArray, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glDisableVertexAttribArray, void, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glUniform1f, void, (GLint p1, GLfloat p2), (p1, p2))\
|
||||
USE_FUNCTION (glUniform1i, void, (GLint p1, GLint p2), (p1, p2))\
|
||||
USE_FUNCTION (glUniform2f, void, (GLint p1, GLfloat p2, GLfloat p3), (p1, p2, p3))\
|
||||
USE_FUNCTION (glUniform3f, void, (GLint p1, GLfloat p2, GLfloat p3, GLfloat p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glUniform4f, void, (GLint p1, GLfloat p2, GLfloat p3, GLfloat p4, GLfloat p5), (p1, p2, p3, p4, p5))\
|
||||
USE_FUNCTION (glUniform4i, void, (GLint p1, GLint p2, GLint p3, GLint p4, GLint p5), (p1, p2, p3, p4, p5))\
|
||||
USE_FUNCTION (glUniform1fv, void, (GLint p1, GLsizei p2, const GLfloat* p3), (p1, p2, p3))\
|
||||
USE_FUNCTION (glUniformMatrix2fv, void, (GLint p1, GLsizei p2, GLboolean p3, const GLfloat* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glUniformMatrix3fv, void, (GLint p1, GLsizei p2, GLboolean p3, const GLfloat* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glUniformMatrix4fv, void, (GLint p1, GLsizei p2, GLboolean p3, const GLfloat* p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glBindAttribLocation, void, (GLuint p1, GLuint p2, const GLchar* p3), (p1, p2, p3))
|
||||
#define JUCE_GL_BASE_FUNCTIONS \
|
||||
X (glActiveTexture) \
|
||||
X (glBindBuffer) \
|
||||
X (glDeleteBuffers) \
|
||||
X (glGenBuffers) \
|
||||
X (glBufferData) \
|
||||
X (glBufferSubData) \
|
||||
X (glCreateProgram) \
|
||||
X (glDeleteProgram) \
|
||||
X (glCreateShader) \
|
||||
X (glDeleteShader) \
|
||||
X (glShaderSource) \
|
||||
X (glCompileShader) \
|
||||
X (glAttachShader) \
|
||||
X (glLinkProgram) \
|
||||
X (glUseProgram) \
|
||||
X (glGetShaderiv) \
|
||||
X (glGetShaderInfoLog) \
|
||||
X (glGetProgramInfoLog) \
|
||||
X (glGetProgramiv) \
|
||||
X (glGetUniformLocation) \
|
||||
X (glGetAttribLocation) \
|
||||
X (glVertexAttribPointer) \
|
||||
X (glEnableVertexAttribArray) \
|
||||
X (glDisableVertexAttribArray) \
|
||||
X (glUniform1f) \
|
||||
X (glUniform1i) \
|
||||
X (glUniform2f) \
|
||||
X (glUniform3f) \
|
||||
X (glUniform4f) \
|
||||
X (glUniform4i) \
|
||||
X (glUniform1fv) \
|
||||
X (glUniformMatrix2fv) \
|
||||
X (glUniformMatrix3fv) \
|
||||
X (glUniformMatrix4fv) \
|
||||
X (glBindAttribLocation)
|
||||
|
||||
/** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
|
||||
@see OpenGLExtensionFunctions
|
||||
*/
|
||||
#define JUCE_GL_EXTENSION_FUNCTIONS(USE_FUNCTION) \
|
||||
USE_FUNCTION (glIsRenderbuffer, GLboolean, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glBindRenderbuffer, void, (GLenum p1, GLuint p2), (p1, p2))\
|
||||
USE_FUNCTION (glDeleteRenderbuffers, void, (GLsizei p1, const GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glGenRenderbuffers, void, (GLsizei p1, GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glRenderbufferStorage, void, (GLenum p1, GLenum p2, GLsizei p3, GLsizei p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glGetRenderbufferParameteriv, void, (GLenum p1, GLenum p2, GLint* p3), (p1, p2, p3))\
|
||||
USE_FUNCTION (glIsFramebuffer, GLboolean, (GLuint p1), (p1))\
|
||||
USE_FUNCTION (glBindFramebuffer, void, (GLenum p1, GLuint p2), (p1, p2))\
|
||||
USE_FUNCTION (glDeleteFramebuffers, void, (GLsizei p1, const GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glGenFramebuffers, void, (GLsizei p1, GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glCheckFramebufferStatus, GLenum, (GLenum p1), (p1))\
|
||||
USE_FUNCTION (glFramebufferTexture2D, void, (GLenum p1, GLenum p2, GLenum p3, GLuint p4, GLint p5), (p1, p2, p3, p4, p5))\
|
||||
USE_FUNCTION (glFramebufferRenderbuffer, void, (GLenum p1, GLenum p2, GLenum p3, GLuint p4), (p1, p2, p3, p4))\
|
||||
USE_FUNCTION (glGetFramebufferAttachmentParameteriv, void, (GLenum p1, GLenum p2, GLenum p3, GLint* p4), (p1, p2, p3, p4))
|
||||
#define JUCE_GL_EXTENSION_FUNCTIONS \
|
||||
X (glIsRenderbuffer) \
|
||||
X (glBindRenderbuffer) \
|
||||
X (glDeleteRenderbuffers) \
|
||||
X (glGenRenderbuffers) \
|
||||
X (glRenderbufferStorage) \
|
||||
X (glGetRenderbufferParameteriv) \
|
||||
X (glIsFramebuffer) \
|
||||
X (glBindFramebuffer) \
|
||||
X (glDeleteFramebuffers) \
|
||||
X (glGenFramebuffers) \
|
||||
X (glCheckFramebufferStatus) \
|
||||
X (glFramebufferTexture2D) \
|
||||
X (glFramebufferRenderbuffer) \
|
||||
X (glGetFramebufferAttachmentParameteriv)
|
||||
|
||||
/** @internal This macro contains a list of GL extension functions that need to be dynamically loaded on Windows/Linux.
|
||||
@see OpenGLExtensionFunctions
|
||||
*/
|
||||
#define JUCE_GL_VERTEXBUFFER_FUNCTIONS(USE_FUNCTION) \
|
||||
USE_FUNCTION (glGenVertexArrays, void, (GLsizei p1, GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glDeleteVertexArrays, void, (GLsizei p1, const GLuint* p2), (p1, p2))\
|
||||
USE_FUNCTION (glBindVertexArray, void, (GLuint p1), (p1))
|
||||
|
||||
#define JUCE_GL_VERTEXBUFFER_FUNCTIONS \
|
||||
X (glGenVertexArrays) \
|
||||
X (glDeleteVertexArrays) \
|
||||
X (glBindVertexArray)
|
||||
|
||||
/** This class contains a generated list of OpenGL extension functions, which are either dynamically loaded
|
||||
for a specific GL context, or simply call-through to the appropriate OS function where available.
|
||||
|
||||
This class is provided for backwards compatibility. In new code, you should prefer to use
|
||||
functions from the juce::gl namespace. By importing all these symbols with
|
||||
`using namespace ::juce::gl;`, all GL enumerations and functions will be made available at
|
||||
global scope. This may be helpful if you need to write code with C source compatibility, or
|
||||
which is compatible with a different extension-loading library.
|
||||
All the normal guidance about `using namespace` should still apply - don't do this in a header,
|
||||
or at all if you can possibly avoid it!
|
||||
|
||||
@tags{OpenGL}
|
||||
*/
|
||||
struct OpenGLExtensionFunctions
|
||||
{
|
||||
void initialise();
|
||||
/** A more complete set of GL commands can be found in the juce::gl namespace.
|
||||
|
||||
You should use juce::gl::loadFunctions() to load GL functions.
|
||||
*/
|
||||
JUCE_DEPRECATED (static void initialise());
|
||||
|
||||
#if JUCE_WINDOWS && ! DOXYGEN
|
||||
typedef char GLchar;
|
||||
|
|
@ -109,52 +120,20 @@ struct OpenGLExtensionFunctions
|
|||
typedef pointer_sized_int GLintptr;
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_WINDOWS
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) typedef returnType (__stdcall *type_ ## name) params; type_ ## name name;
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#if JUCE_OPENGL3
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#endif
|
||||
#define X(name) static decltype (::juce::gl::name)& name;
|
||||
JUCE_GL_BASE_FUNCTIONS
|
||||
JUCE_GL_EXTENSION_FUNCTIONS
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS
|
||||
#undef X
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
#elif JUCE_LINUX || JUCE_BSD
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) typedef returnType (*type_ ## name) params; type_ ## name name;
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#if JUCE_OPENGL3
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#elif JUCE_OPENGL_ES
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept;
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
|
||||
//==============================================================================
|
||||
enum MissingOpenGLDefinitions
|
||||
{
|
||||
#if JUCE_ANDROID
|
||||
JUCE_RGBA_FORMAT = ::juce::gl::GL_RGBA,
|
||||
#else
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name callparams; }
|
||||
JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
|
||||
#ifndef GL3_PROTOTYPES
|
||||
#undef JUCE_DECLARE_GL_FUNCTION
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name ## EXT callparams; }
|
||||
#endif
|
||||
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
|
||||
#if JUCE_OPENGL3
|
||||
#ifndef GL3_PROTOTYPES
|
||||
#undef JUCE_DECLARE_GL_FUNCTION
|
||||
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name ## APPLE callparams; }
|
||||
#endif
|
||||
JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
|
||||
#endif
|
||||
JUCE_RGBA_FORMAT = ::juce::gl::GL_BGRA_EXT,
|
||||
#endif
|
||||
|
||||
#undef JUCE_DECLARE_GL_FUNCTION
|
||||
};
|
||||
|
||||
} // namespace juce
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ public:
|
|||
// I'd prefer to put this stuff in the initialiseOnRenderThread() call, but doing
|
||||
// so causes mysterious timing-related failures.
|
||||
[EAGLContext setCurrentContext: context];
|
||||
gl::loadFunctions();
|
||||
createGLBuffers();
|
||||
deactivateCurrentContext();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,11 +80,9 @@ public:
|
|||
ignoreUnused (version);
|
||||
int numAttribs = 0;
|
||||
|
||||
#if JUCE_OPENGL3
|
||||
attribs[numAttribs++] = NSOpenGLPFAOpenGLProfile;
|
||||
attribs[numAttribs++] = version >= openGL3_2 ? NSOpenGLProfileVersion3_2Core
|
||||
: NSOpenGLProfileVersionLegacy;
|
||||
#endif
|
||||
|
||||
attribs[numAttribs++] = NSOpenGLPFADoubleBuffer;
|
||||
attribs[numAttribs++] = NSOpenGLPFAClosestPolicy;
|
||||
|
|
|
|||
|
|
@ -317,10 +317,8 @@ public:
|
|||
|
||||
void bindVertexArray() noexcept
|
||||
{
|
||||
#if JUCE_OPENGL3
|
||||
if (vertexArrayObject != 0)
|
||||
context.extensions.glBindVertexArray (vertexArrayObject);
|
||||
#endif
|
||||
}
|
||||
|
||||
void checkViewportBounds()
|
||||
|
|
@ -515,25 +513,21 @@ public:
|
|||
context.makeActive();
|
||||
#endif
|
||||
|
||||
context.extensions.initialise();
|
||||
gl::loadFunctions();
|
||||
|
||||
#if JUCE_OPENGL3
|
||||
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
||||
{
|
||||
context.extensions.glGenVertexArrays (1, &vertexArrayObject);
|
||||
bindVertexArray();
|
||||
}
|
||||
#endif
|
||||
|
||||
glViewport (0, 0, component.getWidth(), component.getHeight());
|
||||
|
||||
nativeContext->setSwapInterval (1);
|
||||
|
||||
#if ! JUCE_OPENGL_ES
|
||||
JUCE_CHECK_OPENGL_ERROR
|
||||
shadersAvailable = OpenGLShaderProgram::getLanguageVersion() > 0;
|
||||
clearGLError();
|
||||
#endif
|
||||
|
||||
if (context.renderer != nullptr)
|
||||
context.renderer->newOpenGLContextCreated();
|
||||
|
|
@ -555,10 +549,8 @@ public:
|
|||
if (context.renderer != nullptr)
|
||||
context.renderer->openGLContextClosing();
|
||||
|
||||
#if JUCE_OPENGL3
|
||||
if (vertexArrayObject != 0)
|
||||
context.extensions.glDeleteVertexArrays (1, &vertexArrayObject);
|
||||
#endif
|
||||
|
||||
associatedObjectNames.clear();
|
||||
associatedObjects.clear();
|
||||
|
|
@ -661,9 +653,7 @@ public:
|
|||
Rectangle<int> viewportArea, lastScreenBounds;
|
||||
double scale = 1.0;
|
||||
AffineTransform transform;
|
||||
#if JUCE_OPENGL3
|
||||
GLuint vertexArrayObject = 0;
|
||||
#endif
|
||||
|
||||
StringArray associatedObjectNames;
|
||||
ReferenceCountedArray<ReferenceCountedObject> associatedObjects;
|
||||
|
|
|
|||
|
|
@ -69,11 +69,11 @@ public:
|
|||
jassert (context.extensions.glIsRenderbuffer (depthOrStencilBuffer));
|
||||
|
||||
context.extensions.glRenderbufferStorage (GL_RENDERBUFFER,
|
||||
(wantsDepthBuffer && wantsStencilBuffer) ? GL_DEPTH24_STENCIL8
|
||||
(wantsDepthBuffer && wantsStencilBuffer) ? (GLenum) GL_DEPTH24_STENCIL8
|
||||
#if JUCE_OPENGL_ES
|
||||
: GL_DEPTH_COMPONENT16,
|
||||
: (GLenum) GL_DEPTH_COMPONENT16,
|
||||
#else
|
||||
: GL_DEPTH_COMPONENT,
|
||||
: (GLenum) GL_DEPTH_COMPONENT,
|
||||
#endif
|
||||
width, height);
|
||||
|
||||
|
|
|
|||
|
|
@ -419,18 +419,18 @@ struct ShaderPrograms : public ReferenceCountedObject
|
|||
screenBounds.set (bounds.getX(), bounds.getY(), 0.5f * bounds.getWidth(), 0.5f * bounds.getHeight());
|
||||
}
|
||||
|
||||
void bindAttributes (OpenGLContext& context)
|
||||
void bindAttributes()
|
||||
{
|
||||
context.extensions.glVertexAttribPointer ((GLuint) positionAttribute.attributeID, 2, GL_SHORT, GL_FALSE, 8, nullptr);
|
||||
context.extensions.glVertexAttribPointer ((GLuint) colourAttribute.attributeID, 4, GL_UNSIGNED_BYTE, GL_TRUE, 8, (void*) 4);
|
||||
context.extensions.glEnableVertexAttribArray ((GLuint) positionAttribute.attributeID);
|
||||
context.extensions.glEnableVertexAttribArray ((GLuint) colourAttribute.attributeID);
|
||||
gl::glVertexAttribPointer ((GLuint) positionAttribute.attributeID, 2, GL_SHORT, GL_FALSE, 8, nullptr);
|
||||
gl::glVertexAttribPointer ((GLuint) colourAttribute.attributeID, 4, GL_UNSIGNED_BYTE, GL_TRUE, 8, (void*) 4);
|
||||
gl::glEnableVertexAttribArray ((GLuint) positionAttribute.attributeID);
|
||||
gl::glEnableVertexAttribArray ((GLuint) colourAttribute.attributeID);
|
||||
}
|
||||
|
||||
void unbindAttributes (OpenGLContext& context)
|
||||
void unbindAttributes()
|
||||
{
|
||||
context.extensions.glDisableVertexAttribArray ((GLuint) positionAttribute.attributeID);
|
||||
context.extensions.glDisableVertexAttribArray ((GLuint) colourAttribute.attributeID);
|
||||
gl::glDisableVertexAttribArray ((GLuint) positionAttribute.attributeID);
|
||||
gl::glDisableVertexAttribArray ((GLuint) colourAttribute.attributeID);
|
||||
}
|
||||
|
||||
OpenGLShaderProgram::Attribute positionAttribute, colourAttribute;
|
||||
|
|
@ -1314,7 +1314,7 @@ struct StateHelpers
|
|||
|
||||
activeShader = &shader;
|
||||
shader.program.use();
|
||||
shader.bindAttributes (context);
|
||||
shader.bindAttributes();
|
||||
|
||||
if (shader.onShaderActivated)
|
||||
shader.onShaderActivated (shader.program);
|
||||
|
|
@ -1341,7 +1341,7 @@ struct StateHelpers
|
|||
if (activeShader != nullptr)
|
||||
{
|
||||
quadQueue.flush();
|
||||
activeShader->unbindAttributes (context);
|
||||
activeShader->unbindAttributes();
|
||||
activeShader = nullptr;
|
||||
context.extensions.glUseProgram (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ void OpenGLHelpers::enableScissorTest (Rectangle<int> clip)
|
|||
|
||||
String OpenGLHelpers::translateVertexShaderToV3 (const String& code)
|
||||
{
|
||||
#if JUCE_OPENGL3
|
||||
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
||||
{
|
||||
String output;
|
||||
|
|
@ -112,21 +111,18 @@ String OpenGLHelpers::translateVertexShaderToV3 (const String& code)
|
|||
|
||||
return JUCE_GLSL_VERSION "\n" + output.replace ("varying", "out");
|
||||
}
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
String OpenGLHelpers::translateFragmentShaderToV3 (const String& code)
|
||||
{
|
||||
#if JUCE_OPENGL3
|
||||
if (OpenGLShaderProgram::getLanguageVersion() > 1.2)
|
||||
return JUCE_GLSL_VERSION "\n"
|
||||
"out " JUCE_MEDIUMP " vec4 fragColor;\n"
|
||||
+ code.replace ("varying", "in")
|
||||
.replace ("texture2D", "texture")
|
||||
.replace ("gl_FragColor", "fragColor");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ bool OpenGLShaderProgram::addShader (const String& code, GLenum type)
|
|||
GLint status = GL_FALSE;
|
||||
context.extensions.glGetShaderiv (shaderID, GL_COMPILE_STATUS, &status);
|
||||
|
||||
if (status == GL_FALSE)
|
||||
if (status == (GLint) GL_FALSE)
|
||||
{
|
||||
GLchar infoLog [16384];
|
||||
GLsizei infoLogLength = 0;
|
||||
|
|
@ -113,7 +113,7 @@ bool OpenGLShaderProgram::link() noexcept
|
|||
GLint status = GL_FALSE;
|
||||
context.extensions.glGetProgramiv (progID, GL_LINK_STATUS, &status);
|
||||
|
||||
if (status == GL_FALSE)
|
||||
if (status == (GLint) GL_FALSE)
|
||||
{
|
||||
GLchar infoLog [16384];
|
||||
GLsizei infoLogLength = 0;
|
||||
|
|
@ -129,7 +129,7 @@ bool OpenGLShaderProgram::link() noexcept
|
|||
}
|
||||
|
||||
JUCE_CHECK_OPENGL_ERROR
|
||||
return status != GL_FALSE;
|
||||
return status != (GLint) GL_FALSE;
|
||||
}
|
||||
|
||||
void OpenGLShaderProgram::use() const noexcept
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ void OpenGLTexture::create (const int w, const int h, const void* pixels, GLenum
|
|||
glBindTexture (GL_TEXTURE_2D, textureID);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
auto glMagFilter = (ownerContext->texMagFilter == OpenGLContext::linear ? GL_LINEAR : GL_NEAREST);
|
||||
auto glMagFilter = (GLint) (ownerContext->texMagFilter == OpenGLContext::linear ? GL_LINEAR : GL_NEAREST);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glMagFilter);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
|
|
|||
4063
modules/juce_opengl/opengl/juce_gl.cpp
Normal file
4063
modules/juce_opengl/opengl/juce_gl.cpp
Normal file
File diff suppressed because it is too large
Load diff
11981
modules/juce_opengl/opengl/juce_gl.h
Normal file
11981
modules/juce_opengl/opengl/juce_gl.h
Normal file
File diff suppressed because it is too large
Load diff
1406
modules/juce_opengl/opengl/juce_gles2.cpp
Normal file
1406
modules/juce_opengl/opengl/juce_gles2.cpp
Normal file
File diff suppressed because it is too large
Load diff
5243
modules/juce_opengl/opengl/juce_gles2.h
Normal file
5243
modules/juce_opengl/opengl/juce_gles2.h
Normal file
File diff suppressed because it is too large
Load diff
290
modules/juce_opengl/opengl/juce_khrplatform.h
Normal file
290
modules/juce_opengl/opengl/juce_khrplatform.h
Normal file
|
|
@ -0,0 +1,290 @@
|
|||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
645
modules/juce_opengl/opengl/juce_wgl.h
Normal file
645
modules/juce_opengl/opengl/juce_wgl.h
Normal file
|
|
@ -0,0 +1,645 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2020 - Raw Material Software Limited
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
|
||||
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-6-licence
|
||||
Privacy Policy: www.juce.com/juce-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
// This file was generated automatically using data from the opengl-registry
|
||||
// https://github.com/KhronosGroup/OpenGL-Registry
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
namespace juce
|
||||
{
|
||||
namespace gl
|
||||
{
|
||||
|
||||
|
||||
// WGL_VERSION_1_0
|
||||
#ifndef WGL_FONT_LINES
|
||||
enum
|
||||
{
|
||||
WGL_FONT_LINES = 0,
|
||||
WGL_FONT_POLYGONS = 1,
|
||||
WGL_SWAP_MAIN_PLANE = 0x00000001,
|
||||
WGL_SWAP_OVERLAY1 = 0x00000002,
|
||||
WGL_SWAP_OVERLAY2 = 0x00000004,
|
||||
WGL_SWAP_OVERLAY3 = 0x00000008,
|
||||
WGL_SWAP_OVERLAY4 = 0x00000010,
|
||||
WGL_SWAP_OVERLAY5 = 0x00000020,
|
||||
WGL_SWAP_OVERLAY6 = 0x00000040,
|
||||
WGL_SWAP_OVERLAY7 = 0x00000080,
|
||||
WGL_SWAP_OVERLAY8 = 0x00000100,
|
||||
WGL_SWAP_OVERLAY9 = 0x00000200,
|
||||
WGL_SWAP_OVERLAY10 = 0x00000400,
|
||||
WGL_SWAP_OVERLAY11 = 0x00000800,
|
||||
WGL_SWAP_OVERLAY12 = 0x00001000,
|
||||
WGL_SWAP_OVERLAY13 = 0x00002000,
|
||||
WGL_SWAP_OVERLAY14 = 0x00004000,
|
||||
WGL_SWAP_OVERLAY15 = 0x00008000,
|
||||
WGL_SWAP_UNDERLAY1 = 0x00010000,
|
||||
WGL_SWAP_UNDERLAY2 = 0x00020000,
|
||||
WGL_SWAP_UNDERLAY3 = 0x00040000,
|
||||
WGL_SWAP_UNDERLAY4 = 0x00080000,
|
||||
WGL_SWAP_UNDERLAY5 = 0x00100000,
|
||||
WGL_SWAP_UNDERLAY6 = 0x00200000,
|
||||
WGL_SWAP_UNDERLAY7 = 0x00400000,
|
||||
WGL_SWAP_UNDERLAY8 = 0x00800000,
|
||||
WGL_SWAP_UNDERLAY9 = 0x01000000,
|
||||
WGL_SWAP_UNDERLAY10 = 0x02000000,
|
||||
WGL_SWAP_UNDERLAY11 = 0x04000000,
|
||||
WGL_SWAP_UNDERLAY12 = 0x08000000,
|
||||
WGL_SWAP_UNDERLAY13 = 0x10000000,
|
||||
WGL_SWAP_UNDERLAY14 = 0x20000000,
|
||||
WGL_SWAP_UNDERLAY15 = 0x40000000,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_3DFX_multisample
|
||||
#ifndef WGL_SAMPLE_BUFFERS_3DFX
|
||||
enum
|
||||
{
|
||||
WGL_SAMPLE_BUFFERS_3DFX = 0x2060,
|
||||
WGL_SAMPLES_3DFX = 0x2061,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_3DL_stereo_control
|
||||
#ifndef WGL_STEREO_EMITTER_ENABLE_3DL
|
||||
enum
|
||||
{
|
||||
WGL_STEREO_EMITTER_ENABLE_3DL = 0x2055,
|
||||
WGL_STEREO_EMITTER_DISABLE_3DL = 0x2056,
|
||||
WGL_STEREO_POLARITY_NORMAL_3DL = 0x2057,
|
||||
WGL_STEREO_POLARITY_INVERT_3DL = 0x2058,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_AMD_gpu_association
|
||||
#ifndef WGL_GPU_VENDOR_AMD
|
||||
enum
|
||||
{
|
||||
WGL_GPU_VENDOR_AMD = 0x1F00,
|
||||
WGL_GPU_RENDERER_STRING_AMD = 0x1F01,
|
||||
WGL_GPU_OPENGL_VERSION_STRING_AMD = 0x1F02,
|
||||
WGL_GPU_FASTEST_TARGET_GPUS_AMD = 0x21A2,
|
||||
WGL_GPU_RAM_AMD = 0x21A3,
|
||||
WGL_GPU_CLOCK_AMD = 0x21A4,
|
||||
WGL_GPU_NUM_PIPES_AMD = 0x21A5,
|
||||
WGL_GPU_NUM_SIMD_AMD = 0x21A6,
|
||||
WGL_GPU_NUM_RB_AMD = 0x21A7,
|
||||
WGL_GPU_NUM_SPI_AMD = 0x21A8,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_buffer_region
|
||||
#ifndef WGL_FRONT_COLOR_BUFFER_BIT_ARB
|
||||
enum
|
||||
{
|
||||
WGL_FRONT_COLOR_BUFFER_BIT_ARB = 0x00000001,
|
||||
WGL_BACK_COLOR_BUFFER_BIT_ARB = 0x00000002,
|
||||
WGL_DEPTH_BUFFER_BIT_ARB = 0x00000004,
|
||||
WGL_STENCIL_BUFFER_BIT_ARB = 0x00000008,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_context_flush_control
|
||||
#ifndef WGL_CONTEXT_RELEASE_BEHAVIOR_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_RELEASE_BEHAVIOR_ARB = 0x2097,
|
||||
WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB = 0,
|
||||
WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB = 0x2098,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_create_context
|
||||
#ifndef WGL_CONTEXT_DEBUG_BIT_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_DEBUG_BIT_ARB = 0x00000001,
|
||||
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x00000002,
|
||||
WGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091,
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB = 0x2092,
|
||||
WGL_CONTEXT_LAYER_PLANE_ARB = 0x2093,
|
||||
WGL_CONTEXT_FLAGS_ARB = 0x2094,
|
||||
ERROR_INVALID_VERSION_ARB = 0x2095,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_create_context_no_error
|
||||
#ifndef WGL_CONTEXT_OPENGL_NO_ERROR_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_OPENGL_NO_ERROR_ARB = 0x31B3,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_create_context_profile
|
||||
#ifndef WGL_CONTEXT_PROFILE_MASK_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126,
|
||||
WGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001,
|
||||
WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002,
|
||||
ERROR_INVALID_PROFILE_ARB = 0x2096,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_create_context_robustness
|
||||
#ifndef WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB = 0x00000004,
|
||||
WGL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252,
|
||||
WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256,
|
||||
WGL_NO_RESET_NOTIFICATION_ARB = 0x8261,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_framebuffer_sRGB
|
||||
#ifndef WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB
|
||||
enum
|
||||
{
|
||||
WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB = 0x20A9,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_make_current_read
|
||||
#ifndef ERROR_INVALID_PIXEL_TYPE_ARB
|
||||
enum
|
||||
{
|
||||
ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043,
|
||||
ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_multisample
|
||||
#ifndef WGL_SAMPLE_BUFFERS_ARB
|
||||
enum
|
||||
{
|
||||
WGL_SAMPLE_BUFFERS_ARB = 0x2041,
|
||||
WGL_SAMPLES_ARB = 0x2042,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_pbuffer
|
||||
#ifndef WGL_DRAW_TO_PBUFFER_ARB
|
||||
enum
|
||||
{
|
||||
WGL_DRAW_TO_PBUFFER_ARB = 0x202D,
|
||||
WGL_MAX_PBUFFER_PIXELS_ARB = 0x202E,
|
||||
WGL_MAX_PBUFFER_WIDTH_ARB = 0x202F,
|
||||
WGL_MAX_PBUFFER_HEIGHT_ARB = 0x2030,
|
||||
WGL_PBUFFER_LARGEST_ARB = 0x2033,
|
||||
WGL_PBUFFER_WIDTH_ARB = 0x2034,
|
||||
WGL_PBUFFER_HEIGHT_ARB = 0x2035,
|
||||
WGL_PBUFFER_LOST_ARB = 0x2036,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_pixel_format
|
||||
#ifndef WGL_NUMBER_PIXEL_FORMATS_ARB
|
||||
enum
|
||||
{
|
||||
WGL_NUMBER_PIXEL_FORMATS_ARB = 0x2000,
|
||||
WGL_DRAW_TO_WINDOW_ARB = 0x2001,
|
||||
WGL_DRAW_TO_BITMAP_ARB = 0x2002,
|
||||
WGL_ACCELERATION_ARB = 0x2003,
|
||||
WGL_NEED_PALETTE_ARB = 0x2004,
|
||||
WGL_NEED_SYSTEM_PALETTE_ARB = 0x2005,
|
||||
WGL_SWAP_LAYER_BUFFERS_ARB = 0x2006,
|
||||
WGL_SWAP_METHOD_ARB = 0x2007,
|
||||
WGL_NUMBER_OVERLAYS_ARB = 0x2008,
|
||||
WGL_NUMBER_UNDERLAYS_ARB = 0x2009,
|
||||
WGL_TRANSPARENT_ARB = 0x200A,
|
||||
WGL_TRANSPARENT_RED_VALUE_ARB = 0x2037,
|
||||
WGL_TRANSPARENT_GREEN_VALUE_ARB = 0x2038,
|
||||
WGL_TRANSPARENT_BLUE_VALUE_ARB = 0x2039,
|
||||
WGL_TRANSPARENT_ALPHA_VALUE_ARB = 0x203A,
|
||||
WGL_TRANSPARENT_INDEX_VALUE_ARB = 0x203B,
|
||||
WGL_SHARE_DEPTH_ARB = 0x200C,
|
||||
WGL_SHARE_STENCIL_ARB = 0x200D,
|
||||
WGL_SHARE_ACCUM_ARB = 0x200E,
|
||||
WGL_SUPPORT_GDI_ARB = 0x200F,
|
||||
WGL_SUPPORT_OPENGL_ARB = 0x2010,
|
||||
WGL_DOUBLE_BUFFER_ARB = 0x2011,
|
||||
WGL_STEREO_ARB = 0x2012,
|
||||
WGL_PIXEL_TYPE_ARB = 0x2013,
|
||||
WGL_COLOR_BITS_ARB = 0x2014,
|
||||
WGL_RED_BITS_ARB = 0x2015,
|
||||
WGL_RED_SHIFT_ARB = 0x2016,
|
||||
WGL_GREEN_BITS_ARB = 0x2017,
|
||||
WGL_GREEN_SHIFT_ARB = 0x2018,
|
||||
WGL_BLUE_BITS_ARB = 0x2019,
|
||||
WGL_BLUE_SHIFT_ARB = 0x201A,
|
||||
WGL_ALPHA_BITS_ARB = 0x201B,
|
||||
WGL_ALPHA_SHIFT_ARB = 0x201C,
|
||||
WGL_ACCUM_BITS_ARB = 0x201D,
|
||||
WGL_ACCUM_RED_BITS_ARB = 0x201E,
|
||||
WGL_ACCUM_GREEN_BITS_ARB = 0x201F,
|
||||
WGL_ACCUM_BLUE_BITS_ARB = 0x2020,
|
||||
WGL_ACCUM_ALPHA_BITS_ARB = 0x2021,
|
||||
WGL_DEPTH_BITS_ARB = 0x2022,
|
||||
WGL_STENCIL_BITS_ARB = 0x2023,
|
||||
WGL_AUX_BUFFERS_ARB = 0x2024,
|
||||
WGL_NO_ACCELERATION_ARB = 0x2025,
|
||||
WGL_GENERIC_ACCELERATION_ARB = 0x2026,
|
||||
WGL_FULL_ACCELERATION_ARB = 0x2027,
|
||||
WGL_SWAP_EXCHANGE_ARB = 0x2028,
|
||||
WGL_SWAP_COPY_ARB = 0x2029,
|
||||
WGL_SWAP_UNDEFINED_ARB = 0x202A,
|
||||
WGL_TYPE_RGBA_ARB = 0x202B,
|
||||
WGL_TYPE_COLORINDEX_ARB = 0x202C,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_pixel_format_float
|
||||
#ifndef WGL_TYPE_RGBA_FLOAT_ARB
|
||||
enum
|
||||
{
|
||||
WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_render_texture
|
||||
#ifndef WGL_BIND_TO_TEXTURE_RGB_ARB
|
||||
enum
|
||||
{
|
||||
WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070,
|
||||
WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071,
|
||||
WGL_TEXTURE_FORMAT_ARB = 0x2072,
|
||||
WGL_TEXTURE_TARGET_ARB = 0x2073,
|
||||
WGL_MIPMAP_TEXTURE_ARB = 0x2074,
|
||||
WGL_TEXTURE_RGB_ARB = 0x2075,
|
||||
WGL_TEXTURE_RGBA_ARB = 0x2076,
|
||||
WGL_NO_TEXTURE_ARB = 0x2077,
|
||||
WGL_TEXTURE_CUBE_MAP_ARB = 0x2078,
|
||||
WGL_TEXTURE_1D_ARB = 0x2079,
|
||||
WGL_TEXTURE_2D_ARB = 0x207A,
|
||||
WGL_MIPMAP_LEVEL_ARB = 0x207B,
|
||||
WGL_CUBE_MAP_FACE_ARB = 0x207C,
|
||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D,
|
||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E,
|
||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F,
|
||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080,
|
||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081,
|
||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082,
|
||||
WGL_FRONT_LEFT_ARB = 0x2083,
|
||||
WGL_FRONT_RIGHT_ARB = 0x2084,
|
||||
WGL_BACK_LEFT_ARB = 0x2085,
|
||||
WGL_BACK_RIGHT_ARB = 0x2086,
|
||||
WGL_AUX0_ARB = 0x2087,
|
||||
WGL_AUX1_ARB = 0x2088,
|
||||
WGL_AUX2_ARB = 0x2089,
|
||||
WGL_AUX3_ARB = 0x208A,
|
||||
WGL_AUX4_ARB = 0x208B,
|
||||
WGL_AUX5_ARB = 0x208C,
|
||||
WGL_AUX6_ARB = 0x208D,
|
||||
WGL_AUX7_ARB = 0x208E,
|
||||
WGL_AUX8_ARB = 0x208F,
|
||||
WGL_AUX9_ARB = 0x2090,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ARB_robustness_application_isolation
|
||||
#ifndef WGL_CONTEXT_RESET_ISOLATION_BIT_ARB
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_RESET_ISOLATION_BIT_ARB = 0x00000008,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ATI_pixel_format_float
|
||||
#ifndef WGL_TYPE_RGBA_FLOAT_ATI
|
||||
enum
|
||||
{
|
||||
WGL_TYPE_RGBA_FLOAT_ATI = 0x21A0,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_ATI_render_texture_rectangle
|
||||
#ifndef WGL_TEXTURE_RECTANGLE_ATI
|
||||
enum
|
||||
{
|
||||
WGL_TEXTURE_RECTANGLE_ATI = 0x21A5,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_colorspace
|
||||
#ifndef WGL_COLORSPACE_EXT
|
||||
enum
|
||||
{
|
||||
WGL_COLORSPACE_EXT = 0x309D,
|
||||
WGL_COLORSPACE_SRGB_EXT = 0x3089,
|
||||
WGL_COLORSPACE_LINEAR_EXT = 0x308A,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_create_context_es_profile
|
||||
#ifndef WGL_CONTEXT_ES_PROFILE_BIT_EXT
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_ES_PROFILE_BIT_EXT = 0x00000004,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_create_context_es2_profile
|
||||
#ifndef WGL_CONTEXT_ES2_PROFILE_BIT_EXT
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_ES2_PROFILE_BIT_EXT = 0x00000004,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_depth_float
|
||||
#ifndef WGL_DEPTH_FLOAT_EXT
|
||||
enum
|
||||
{
|
||||
WGL_DEPTH_FLOAT_EXT = 0x2040,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_framebuffer_sRGB
|
||||
#ifndef WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT
|
||||
enum
|
||||
{
|
||||
WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20A9,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_make_current_read
|
||||
#ifndef ERROR_INVALID_PIXEL_TYPE_EXT
|
||||
enum
|
||||
{
|
||||
ERROR_INVALID_PIXEL_TYPE_EXT = 0x2043,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_multisample
|
||||
#ifndef WGL_SAMPLE_BUFFERS_EXT
|
||||
enum
|
||||
{
|
||||
WGL_SAMPLE_BUFFERS_EXT = 0x2041,
|
||||
WGL_SAMPLES_EXT = 0x2042,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_pbuffer
|
||||
#ifndef WGL_DRAW_TO_PBUFFER_EXT
|
||||
enum
|
||||
{
|
||||
WGL_DRAW_TO_PBUFFER_EXT = 0x202D,
|
||||
WGL_MAX_PBUFFER_PIXELS_EXT = 0x202E,
|
||||
WGL_MAX_PBUFFER_WIDTH_EXT = 0x202F,
|
||||
WGL_MAX_PBUFFER_HEIGHT_EXT = 0x2030,
|
||||
WGL_OPTIMAL_PBUFFER_WIDTH_EXT = 0x2031,
|
||||
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT = 0x2032,
|
||||
WGL_PBUFFER_LARGEST_EXT = 0x2033,
|
||||
WGL_PBUFFER_WIDTH_EXT = 0x2034,
|
||||
WGL_PBUFFER_HEIGHT_EXT = 0x2035,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_pixel_format
|
||||
#ifndef WGL_NUMBER_PIXEL_FORMATS_EXT
|
||||
enum
|
||||
{
|
||||
WGL_NUMBER_PIXEL_FORMATS_EXT = 0x2000,
|
||||
WGL_DRAW_TO_WINDOW_EXT = 0x2001,
|
||||
WGL_DRAW_TO_BITMAP_EXT = 0x2002,
|
||||
WGL_ACCELERATION_EXT = 0x2003,
|
||||
WGL_NEED_PALETTE_EXT = 0x2004,
|
||||
WGL_NEED_SYSTEM_PALETTE_EXT = 0x2005,
|
||||
WGL_SWAP_LAYER_BUFFERS_EXT = 0x2006,
|
||||
WGL_SWAP_METHOD_EXT = 0x2007,
|
||||
WGL_NUMBER_OVERLAYS_EXT = 0x2008,
|
||||
WGL_NUMBER_UNDERLAYS_EXT = 0x2009,
|
||||
WGL_TRANSPARENT_EXT = 0x200A,
|
||||
WGL_TRANSPARENT_VALUE_EXT = 0x200B,
|
||||
WGL_SHARE_DEPTH_EXT = 0x200C,
|
||||
WGL_SHARE_STENCIL_EXT = 0x200D,
|
||||
WGL_SHARE_ACCUM_EXT = 0x200E,
|
||||
WGL_SUPPORT_GDI_EXT = 0x200F,
|
||||
WGL_SUPPORT_OPENGL_EXT = 0x2010,
|
||||
WGL_DOUBLE_BUFFER_EXT = 0x2011,
|
||||
WGL_STEREO_EXT = 0x2012,
|
||||
WGL_PIXEL_TYPE_EXT = 0x2013,
|
||||
WGL_COLOR_BITS_EXT = 0x2014,
|
||||
WGL_RED_BITS_EXT = 0x2015,
|
||||
WGL_RED_SHIFT_EXT = 0x2016,
|
||||
WGL_GREEN_BITS_EXT = 0x2017,
|
||||
WGL_GREEN_SHIFT_EXT = 0x2018,
|
||||
WGL_BLUE_BITS_EXT = 0x2019,
|
||||
WGL_BLUE_SHIFT_EXT = 0x201A,
|
||||
WGL_ALPHA_BITS_EXT = 0x201B,
|
||||
WGL_ALPHA_SHIFT_EXT = 0x201C,
|
||||
WGL_ACCUM_BITS_EXT = 0x201D,
|
||||
WGL_ACCUM_RED_BITS_EXT = 0x201E,
|
||||
WGL_ACCUM_GREEN_BITS_EXT = 0x201F,
|
||||
WGL_ACCUM_BLUE_BITS_EXT = 0x2020,
|
||||
WGL_ACCUM_ALPHA_BITS_EXT = 0x2021,
|
||||
WGL_DEPTH_BITS_EXT = 0x2022,
|
||||
WGL_STENCIL_BITS_EXT = 0x2023,
|
||||
WGL_AUX_BUFFERS_EXT = 0x2024,
|
||||
WGL_NO_ACCELERATION_EXT = 0x2025,
|
||||
WGL_GENERIC_ACCELERATION_EXT = 0x2026,
|
||||
WGL_FULL_ACCELERATION_EXT = 0x2027,
|
||||
WGL_SWAP_EXCHANGE_EXT = 0x2028,
|
||||
WGL_SWAP_COPY_EXT = 0x2029,
|
||||
WGL_SWAP_UNDEFINED_EXT = 0x202A,
|
||||
WGL_TYPE_RGBA_EXT = 0x202B,
|
||||
WGL_TYPE_COLORINDEX_EXT = 0x202C,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_EXT_pixel_format_packed_float
|
||||
#ifndef WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT
|
||||
enum
|
||||
{
|
||||
WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT = 0x20A8,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_I3D_digital_video_control
|
||||
#ifndef WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D
|
||||
enum
|
||||
{
|
||||
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D = 0x2050,
|
||||
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D = 0x2051,
|
||||
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D = 0x2052,
|
||||
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D = 0x2053,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_I3D_gamma
|
||||
#ifndef WGL_GAMMA_TABLE_SIZE_I3D
|
||||
enum
|
||||
{
|
||||
WGL_GAMMA_TABLE_SIZE_I3D = 0x204E,
|
||||
WGL_GAMMA_EXCLUDE_DESKTOP_I3D = 0x204F,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_I3D_genlock
|
||||
#ifndef WGL_GENLOCK_SOURCE_MULTIVIEW_I3D
|
||||
enum
|
||||
{
|
||||
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D = 0x2044,
|
||||
WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D = 0x2045,
|
||||
WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D = 0x2046,
|
||||
WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D = 0x2047,
|
||||
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D = 0x2048,
|
||||
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D = 0x2049,
|
||||
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D = 0x204A,
|
||||
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D = 0x204B,
|
||||
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D = 0x204C,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_I3D_image_buffer
|
||||
#ifndef WGL_IMAGE_BUFFER_MIN_ACCESS_I3D
|
||||
enum
|
||||
{
|
||||
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D = 0x00000001,
|
||||
WGL_IMAGE_BUFFER_LOCK_I3D = 0x00000002,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_DX_interop
|
||||
#ifndef WGL_ACCESS_READ_ONLY_NV
|
||||
enum
|
||||
{
|
||||
WGL_ACCESS_READ_ONLY_NV = 0x00000000,
|
||||
WGL_ACCESS_READ_WRITE_NV = 0x00000001,
|
||||
WGL_ACCESS_WRITE_DISCARD_NV = 0x00000002,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_float_buffer
|
||||
#ifndef WGL_FLOAT_COMPONENTS_NV
|
||||
enum
|
||||
{
|
||||
WGL_FLOAT_COMPONENTS_NV = 0x20B0,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = 0x20B1,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = 0x20B2,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = 0x20B3,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = 0x20B4,
|
||||
WGL_TEXTURE_FLOAT_R_NV = 0x20B5,
|
||||
WGL_TEXTURE_FLOAT_RG_NV = 0x20B6,
|
||||
WGL_TEXTURE_FLOAT_RGB_NV = 0x20B7,
|
||||
WGL_TEXTURE_FLOAT_RGBA_NV = 0x20B8,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_gpu_affinity
|
||||
#ifndef ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV
|
||||
enum
|
||||
{
|
||||
ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV = 0x20D0,
|
||||
ERROR_MISSING_AFFINITY_MASK_NV = 0x20D1,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_multisample_coverage
|
||||
#ifndef WGL_COVERAGE_SAMPLES_NV
|
||||
enum
|
||||
{
|
||||
WGL_COVERAGE_SAMPLES_NV = 0x2042,
|
||||
WGL_COLOR_SAMPLES_NV = 0x20B9,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_present_video
|
||||
#ifndef WGL_NUM_VIDEO_SLOTS_NV
|
||||
enum
|
||||
{
|
||||
WGL_NUM_VIDEO_SLOTS_NV = 0x20F0,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_render_depth_texture
|
||||
#ifndef WGL_BIND_TO_TEXTURE_DEPTH_NV
|
||||
enum
|
||||
{
|
||||
WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4,
|
||||
WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5,
|
||||
WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6,
|
||||
WGL_DEPTH_COMPONENT_NV = 0x20A7,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_render_texture_rectangle
|
||||
#ifndef WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV
|
||||
enum
|
||||
{
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0,
|
||||
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1,
|
||||
WGL_TEXTURE_RECTANGLE_NV = 0x20A2,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_video_capture
|
||||
#ifndef WGL_UNIQUE_ID_NV
|
||||
enum
|
||||
{
|
||||
WGL_UNIQUE_ID_NV = 0x20CE,
|
||||
WGL_NUM_VIDEO_CAPTURE_SLOTS_NV = 0x20CF,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_video_output
|
||||
#ifndef WGL_BIND_TO_VIDEO_RGB_NV
|
||||
enum
|
||||
{
|
||||
WGL_BIND_TO_VIDEO_RGB_NV = 0x20C0,
|
||||
WGL_BIND_TO_VIDEO_RGBA_NV = 0x20C1,
|
||||
WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV = 0x20C2,
|
||||
WGL_VIDEO_OUT_COLOR_NV = 0x20C3,
|
||||
WGL_VIDEO_OUT_ALPHA_NV = 0x20C4,
|
||||
WGL_VIDEO_OUT_DEPTH_NV = 0x20C5,
|
||||
WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV = 0x20C6,
|
||||
WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV = 0x20C7,
|
||||
WGL_VIDEO_OUT_FRAME = 0x20C8,
|
||||
WGL_VIDEO_OUT_FIELD_1 = 0x20C9,
|
||||
WGL_VIDEO_OUT_FIELD_2 = 0x20CA,
|
||||
WGL_VIDEO_OUT_STACKED_FIELDS_1_2 = 0x20CB,
|
||||
WGL_VIDEO_OUT_STACKED_FIELDS_2_1 = 0x20CC,
|
||||
};
|
||||
#endif
|
||||
|
||||
// WGL_NV_multigpu_context
|
||||
#ifndef WGL_CONTEXT_MULTIGPU_ATTRIB_NV
|
||||
enum
|
||||
{
|
||||
WGL_CONTEXT_MULTIGPU_ATTRIB_NV = 0x20AA,
|
||||
WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV = 0x20AB,
|
||||
WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV = 0x20AC,
|
||||
WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV = 0x20AD,
|
||||
WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV = 0x20AE,
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue