X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbatch.cpp;h=375c52e9ca25da98131f76924eb457b80bf9f255;hb=69bd7cdfb824c9189ef89e112222141c28b163f6;hp=b4b88176559a744ffa602fed13951ebd8a65b669;hpb=2e7f19b895424c3a77940e648639f8df2b395d0f;p=libs%2Fgl.git diff --git a/source/batch.cpp b/source/batch.cpp index b4b88176..375c52e9 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -5,6 +5,7 @@ #include "extension.h" #include "nv_primitive_restart.h" #include "vertexarray.h" +#include "version_1_2.h" using namespace std; @@ -24,7 +25,11 @@ Batch::Batch(PrimitiveType t): next_in_ibuf(0), prev_in_ibuf(0), dirty(false) -{ } +{ + /* XXX Should probably provide a fallback to glDrawElements since this class + is pretty much required to render anything. */ + static RequireVersion _ver(1, 2); +} Batch::~Batch() { @@ -244,7 +249,7 @@ void Batch::draw() const BufferAlias alias(*ibuf); Bind bind_ibuf(alias, true); - glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, (void *)ibuf_offset); + glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, reinterpret_cast(ibuf_offset)); } else glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, &data[0]);