Browse Source

Don't try to develop our own OpenGL (naming).

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
49b126abc6
  1. 18
      src/Buffer.h
  2. 4
      src/Primitives/Cube.cpp
  3. 2
      src/Primitives/Icosphere.h

18
src/Buffer.h

@ -51,54 +51,54 @@ class Buffer {
/** /**
* Set once by the application and used infrequently for drawing. * Set once by the application and used infrequently for drawing.
*/ */
DrawStream = GL_STREAM_DRAW, StreamDraw = GL_STREAM_DRAW,
/** /**
* Set once as output from an OpenGL command and used infequently * Set once as output from an OpenGL command and used infequently
* for drawing. * for drawing.
*/ */
ReadStream = GL_STREAM_READ, StreamRead = GL_STREAM_READ,
/** /**
* Set once as output from an OpenGL command and used infrequently * Set once as output from an OpenGL command and used infrequently
* for drawing or copying to other buffers. * for drawing or copying to other buffers.
*/ */
CopyStream = GL_STREAM_COPY, StreamCopy = GL_STREAM_COPY,
/** /**
* Set once by the application and used frequently for drawing. * Set once by the application and used frequently for drawing.
*/ */
DrawStatic = GL_STATIC_DRAW, StaticDraw = GL_STATIC_DRAW,
/** /**
* Set once as output from an OpenGL command and queried many times * Set once as output from an OpenGL command and queried many times
* by the application. * by the application.
*/ */
ReadStatic = GL_STATIC_READ, StaticRead = GL_STATIC_READ,
/** /**
* Set once as output from an OpenGL command and used frequently * Set once as output from an OpenGL command and used frequently
* for drawing or copying to other buffers. * for drawing or copying to other buffers.
*/ */
CopyStatic = GL_STATIC_COPY, StaticCopy = GL_STATIC_COPY,
/** /**
* Updated frequently by the application and used frequently * Updated frequently by the application and used frequently
* for drawing or copying to other images. * for drawing or copying to other images.
*/ */
DrawDynamic = GL_DYNAMIC_DRAW, DynamicDraw = GL_DYNAMIC_DRAW,
/** /**
* Updated frequently as output from OpenGL command and queried * Updated frequently as output from OpenGL command and queried
* many times from the application. * many times from the application.
*/ */
ReadDynamic = GL_DYNAMIC_READ, DynamicRead = GL_DYNAMIC_READ,
/** /**
* Updated frequently as output from OpenGL command and used * Updated frequently as output from OpenGL command and used
* frequently for drawing or copying to other images. * frequently for drawing or copying to other images.
*/ */
CopyDynamic = GL_DYNAMIC_COPY DynamicCopy = GL_DYNAMIC_COPY
}; };
/** /**

4
src/Primitives/Cube.cpp

@ -49,8 +49,8 @@ const GLubyte Cube::_indices[] = {
void Cube::build(IndexedMesh* mesh, Buffer* vertexBuffer) { void Cube::build(IndexedMesh* mesh, Buffer* vertexBuffer) {
prepareMesh(mesh); prepareMesh(mesh);
vertexBuffer->setData(sizeof(_vertices), _vertices, Buffer::DrawStatic); vertexBuffer->setData(sizeof(_vertices), _vertices, Buffer::StaticDraw);
mesh->indexBuffer()->setData(sizeof(_indices), _indices, Buffer::DrawStatic); mesh->indexBuffer()->setData(sizeof(_indices), _indices, Buffer::StaticDraw);
} }
}} }}

2
src/Primitives/Icosphere.h

@ -54,7 +54,7 @@ template<size_t subdivisions> class Icosphere: public AbstractPrimitive<typename
inline void build(IndexedMesh* mesh, Buffer* vertexBuffer) { inline void build(IndexedMesh* mesh, Buffer* vertexBuffer) {
/* mesh is prepared by the builder, no need to call prepareMesh */ /* mesh is prepared by the builder, no need to call prepareMesh */
builder()->build(mesh, vertexBuffer, Buffer::DrawStatic, Buffer::DrawStatic); builder()->build(mesh, vertexBuffer, Buffer::StaticDraw, Buffer::StaticDraw);
} }
private: private:

Loading…
Cancel
Save