mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Skybox VBOs.
git-svn-id: https://svn.eduke32.com/eduke32@780 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
77a2adbd62
commit
b3ac01c04d
1 changed files with 27 additions and 2 deletions
|
@ -114,6 +114,8 @@ GLfloat skyboxdata[4 * 5 * 6] =
|
||||||
1.0f, 0.0f,
|
1.0f, 0.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GLuint skyboxdatavbo;
|
||||||
|
|
||||||
GLfloat artskydata[16];
|
GLfloat artskydata[16];
|
||||||
|
|
||||||
// CONTROL
|
// CONTROL
|
||||||
|
@ -2260,6 +2262,19 @@ static void polymer_drawskybox(short tilenum)
|
||||||
pthtyp* pth;
|
pthtyp* pth;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if ((pr_vbos > 0) && (skyboxdatavbo == 0))
|
||||||
|
{
|
||||||
|
bglGenBuffersARB(1, &skyboxdatavbo);
|
||||||
|
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, skyboxdatavbo);
|
||||||
|
bglBufferDataARB(GL_ARRAY_BUFFER_ARB, 4 * sizeof(GLfloat) * 5 * 6, skyboxdata, modelvbousage);
|
||||||
|
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pr_vbos > 0)
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, skyboxdatavbo);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < 6)
|
while (i < 6)
|
||||||
{
|
{
|
||||||
|
@ -2267,13 +2282,23 @@ static void polymer_drawskybox(short tilenum)
|
||||||
pth = gltexcache(tilenum, 0, 4);
|
pth = gltexcache(tilenum, 0, 4);
|
||||||
|
|
||||||
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
|
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
|
||||||
|
if (pr_vbos > 0)
|
||||||
|
{
|
||||||
|
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(4 * 5 * i * sizeof(GLfloat)));
|
||||||
|
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(((4 * 5 * i) + 3) * sizeof(GLfloat)));
|
||||||
|
} else {
|
||||||
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[4 * 5 * i]);
|
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[4 * 5 * i]);
|
||||||
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[3 + (4 * 5 * i)]);
|
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &skyboxdata[3 + (4 * 5 * i)]);
|
||||||
|
}
|
||||||
bglDrawArrays(GL_QUADS, 0, 4);
|
bglDrawArrays(GL_QUADS, 0, 4);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
drawingskybox = 0;
|
drawingskybox = 0;
|
||||||
|
|
||||||
|
if (pr_vbos > 0)
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue