- renamed WipeVertexBuffer to FSimpleVertexBuffer because this will be useful elsewhere, too.
This commit is contained in:
parent
52537b0af2
commit
04c59b434b
4 changed files with 41 additions and 48 deletions
|
|
@ -271,51 +271,6 @@ void OpenGLFrameBuffer::WipeCleanup()
|
|||
FMaterial::ClearLastTexture();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// The wiper vertex buffer
|
||||
//
|
||||
// Note that this will recreate the buffer each frame, although
|
||||
// only for melt its contents will change.
|
||||
//
|
||||
// But since this is no time critical code, ease of implementation
|
||||
// was chosen over maximum efficiency.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
class OpenGLFrameBuffer::Wiper::WipeVertexBuffer : public FVertexBuffer
|
||||
{
|
||||
public:
|
||||
WipeVertexBuffer()
|
||||
{
|
||||
}
|
||||
void BindVBO()
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
|
||||
if (gl.glslversion > 0)
|
||||
{
|
||||
glVertexAttribPointer(VATTR_VERTEX, 3, GL_FLOAT, false, sizeof(FFlatVertex), &VTO->x);
|
||||
glVertexAttribPointer(VATTR_TEXCOORD, 2, GL_FLOAT, false, sizeof(FFlatVertex), &VTO->u);
|
||||
glDisableVertexAttribArray(VATTR_COLOR);
|
||||
glDisableVertexAttribArray(VATTR_VERTEX2);
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, sizeof(FFlatVertex), &VTO->x);
|
||||
glTexCoordPointer(2, GL_FLOAT, sizeof(FFlatVertex), &VTO->u);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
}
|
||||
}
|
||||
void set(FFlatVertex *verts, int count)
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
|
||||
gl_RenderState.SetVertexBuffer(this);
|
||||
glBufferData(GL_ARRAY_BUFFER, count * sizeof(*verts), verts, GL_STREAM_DRAW);
|
||||
}
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// OpenGLFrameBuffer :: Wiper Constructor
|
||||
|
|
@ -323,7 +278,7 @@ public:
|
|||
//==========================================================================
|
||||
OpenGLFrameBuffer::Wiper::Wiper()
|
||||
{
|
||||
mVertexBuf = new WipeVertexBuffer;
|
||||
mVertexBuf = new FSimpleVertexBuffer;
|
||||
}
|
||||
|
||||
OpenGLFrameBuffer::Wiper::~Wiper()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue