Replace some constants absent in GL ES

pull/110/head
Hleb Valoshka 2018-09-29 17:52:55 +03:00
parent 73a869c137
commit 524cbd518f
3 changed files with 7 additions and 12 deletions

View File

@ -377,7 +377,7 @@ ParticleEmitter::render(double tsec,
// When the particle buffer is full, render the particles and flush it
if (particleCount == particleBufferCapacity)
{
glDrawArrays(GL_QUADS, 0, particleCount * 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, particleCount * 4);
particleCount = 0;
}
@ -436,7 +436,7 @@ ParticleEmitter::render(double tsec,
// Render any remaining particles in the buffer
if (particleCount > 0)
{
glDrawArrays(GL_QUADS, 0, particleCount * 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, particleCount * 4);
}
}

View File

@ -91,11 +91,6 @@ using namespace std;
#define NEAR_DIST 0.5f
#define FAR_DIST 1.0e9f
// This should be in the GL headers, but where?
#ifndef GL_COLOR_SUM_EXT
#define GL_COLOR_SUM_EXT 0x8458
#endif
static const float STAR_DISTANCE_LIMIT = 1.0e6f;
static const int REF_DISTANCE_TO_SCREEN = 400; //[mm]
@ -382,7 +377,7 @@ void StarVertexBuffer::render()
{
if (nStars != 0)
{
glDrawArrays(GL_QUADS, 0, nStars * 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, nStars * 4);
nStars = 0;
}
}

View File

@ -847,8 +847,8 @@ FramebufferObject::generateColorTexture()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Clamp to edge
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Set the texture dimensions
// Do we need to set GL_DEPTH_COMPONENT24 here?
@ -871,8 +871,8 @@ FramebufferObject::generateDepthTexture()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// Clamp to edge
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Set the texture dimensions
// Do we need to set GL_DEPTH_COMPONENT24 here?