Commit Graph

20 Commits

Author SHA1 Message Date
vrld 6ffb9d28f0 VertexBuffer/SpriteBatch speed tweaks.
- VertexBuffer holds permanent copy of the vertex data and is only read from
  GPU memory was written outside a sb:bind()/sb:unbind() pair.

- "Orphan" the current GPU buffer on unmap() before uploading the changed data
  to the GPU to avoid implicit synchronisation lags.
2012-11-22 20:59:47 +01:00
vrld 6c850fdc98 Possibly (code in issue does not fail on my machine) fix #486. Please test. 2012-10-15 17:13:08 +02:00
Bart van Strien 7793e7f02f CRLF to LF 2012-07-04 14:40:24 +02:00
rude 81c38e22d0 Applied the new style guidelines.
Well, sort of. Lot's more to be done, but this is a start.
2012-06-28 23:52:33 +02:00
vrld 39e1c59989 Actually copy existing buffer data to temporary memory region in VBO::map(). 2012-03-07 23:33:27 +01:00
vrld 6dee041a9d Throw exception when VBO cannot allocate enough memory in VBO::map(). 2012-03-07 23:26:03 +01:00
vrld 3f365857ee Replace glMapBufferARB() with temp memory + glBufferSubDataARB().
Instead of letting OpenGL manage the memory mapping, allocate a temporary
block of memory upon VBO:map(). Upon VBO::unmap() the block is copied to
graphics memory using glBufferSubDataARB() and then released.

Hopefully this will fix some weird error with Windows XP + old drivers, where
VBOs can be created, but the mapped memory cannot be allocated resulting in
the sprite batch drawing nothing at all.

According to the interwebs this could actually faster than using OpenGL mapped
memory, because there is no unnecessary syncing involved.
2012-03-07 23:24:29 +01:00
vrld 2b6cc4ea8c Move VertexBuffer::Bind implementation to header to hint inlining 2012-03-07 23:01:05 +01:00
vrld 1dd40b690b Some idiot put a != where there should be a ==. 2012-03-05 22:14:00 +01:00
vrld febd7757fc Make sure all error flags are cleared before calling glBufferDataARB() in VBO::load(). 2012-03-05 20:58:17 +01:00
vrld c0ffa5b07e Add error checking in VBO::load().
VertexBuffer should now be able to fall back to vertex arrays if
glBufferDataARB() fails (possible due to lack of memory).
2012-03-05 20:46:46 +01:00
Bart van Strien 386dd53780 Make VertexBuffers use size_t, raising the limit of vertices that can be stored
This means more sprites in SpriteBatches, yay!
2012-01-24 23:02:35 +01:00
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien 53e010a832 Remove all uses of LOVE_UNUSED, and simply not name the arguments instead 2011-12-20 20:26:17 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
Bill Meltsner 57f9cf439e Add LOVE_UNUSED macro to stamp out all those "unused parameter" warnings 2011-10-12 14:03:38 -05:00
rude 873a99aba1 Add missing #include in VertexBuffer.cpp. 2011-08-12 13:38:42 +02:00
rude 480f936815 Added 'VertexBuffer' abstraction. SpriteBatches are now always supported.
Also improved memory usage in SpriteBatch. (No need to retain full copy of
sprites in memory. Can read that data back later to save data from OpenGL
context destruction).
2011-08-12 11:35:14 +02:00
rude 84bf839872 Removed classes which should be implemented in Lua (or need of re-implementation). 2009-07-26 23:08:40 +02:00
rude dcb3dfd83d Initial Mercurial commit. 2009-07-26 15:46:49 +02:00