16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-09-01 10:29:18 +02:00

this seems to be causing glitches

This reverts commit 3a713dd1ed.

Revert "this seems to be causing glitches"

This reverts commit ffda7fd4552dc11b6240332195e603e012d740b0.

Revert "vao changes"

This reverts commit 60e38616bd.
This commit is contained in:
milek7
2017-08-06 17:16:08 +02:00
parent 3a713dd1ed
commit 06f00ebdeb
2 changed files with 125 additions and 4 deletions

View File

@@ -164,7 +164,8 @@ public:
static
void
reset() {
m_activebuffer = 0; }
m_activebuffer = 0;
m_activestreams = stream::none; }
private:
// types:
@@ -198,6 +199,7 @@ private:
// members:
static GLuint m_activebuffer; // buffer bound currently on the opengl end, if any
static unsigned int m_activestreams;
GLuint m_buffer { NULL }; // id of the buffer holding data on the opengl end
GLuint m_vao = 0;
std::size_t m_buffercapacity{ 0 }; // total capacity of the last established buffer
@@ -205,6 +207,48 @@ private:
};
// opengl display list based variant of the geometry bank
class opengl_dlgeometrybank : public geometry_bank {
public:
// constructors:
opengl_dlgeometrybank() = default;
// destructor:
~opengl_dlgeometrybank() {
for( auto &chunkrecord : m_chunkrecords ) {
::glDeleteLists( chunkrecord.list, 1 ); } }
private:
// types:
struct chunk_record {
GLuint list { 0 }; // display list associated with the chunk
unsigned int streams { 0 }; // stream combination used to generate the display list
};
typedef std::vector<chunk_record> chunkrecord_sequence;
// methods:
// create() subclass details
void
create_( geometry_handle const &Geometry );
// replace() subclass details
void
replace_( geometry_handle const &Geometry );
// draw() subclass details
void
draw_( geometry_handle const &Geometry, unsigned int const Streams );
// release () subclass details
void
release_();
void
delete_list( geometry_handle const &Geometry );
// members:
chunkrecord_sequence m_chunkrecords; // helper data for all stored geometry chunks, in matching order
};
// geometry bank manager, holds collection of geometry banks
typedef geometry_handle geometrybank_handle;