DXGL r605 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r604‎ | r605 | r606 >
Date:19:11, 11 April 2015
Author:admin
Status:new
Tags:
Comment:
Move buffer objects to a manged object.
Modified paths:
  • /ddraw/BufferObject.cpp (added) (history)
  • /ddraw/BufferObject.h (added) (history)
  • /ddraw/TextureManager.c (modified) (history)
  • /ddraw/TextureManager.h (modified) (history)
  • /ddraw/common.h (modified) (history)
  • /ddraw/ddraw.vcxproj (modified) (history)
  • /ddraw/ddraw.vcxproj.filters (modified) (history)
  • /ddraw/glExtensions.c (modified) (history)
  • /ddraw/glExtensions.h (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glRenderer.h (modified) (history)
  • /ddraw/glUtil.cpp (modified) (history)
  • /ddraw/glUtil.h (modified) (history)

Diff [purge]

Index: ddraw/BufferObject.cpp
@@ -0,0 +1,119 @@
 2+// DXGL
 3+// Copyright (C) 2015 William Feely
 4+
 5+// This library is free software; you can redistribute it and/or
 6+// modify it under the terms of the GNU Lesser General Public
 7+// License as published by the Free Software Foundation; either
 8+// version 2.1 of the License, or (at your option) any later version.
 9+
 10+// This library is distributed in the hope that it will be useful,
 11+// but WITHOUT ANY W ARRANTY; without even the implied warranty of
 12+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 13+// Lesser General Public License for more details.
 14+
 15+// You should have received a copy of the GNU Lesser General Public
 16+// License along with this library; if not, write to the Free Software
 17+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 18+
 19+#include "common.h"
 20+#include "glUtil.h"
 21+#include "BufferObject.h"
 22+
 23+extern "C" {
 24+
 25+void BufferObject_Create(BufferObject **out, glExtensions *ext, glUtil *util)
 26+{
 27+ BufferObject *buffer = (BufferObject*)malloc(sizeof(BufferObject));
 28+ if (!buffer)
 29+ {
 30+ *out = NULL;
 31+ return;
 32+ }
 33+ ZeroMemory(buffer, sizeof(BufferObject));
 34+ buffer->ext = ext;
 35+ buffer->util = util;
 36+ ext->glGenBuffers(1, &buffer->buffer);
 37+}
 38+
 39+void BufferObject_AddRef(BufferObject *This)
 40+{
 41+ InterlockedIncrement(&This->refcount);
 42+}
 43+
 44+void BufferObject_Release(BufferObject *This)
 45+{
 46+ InterlockedDecrement(&This->refcount);
 47+ if (!This->refcount)
 48+ {
 49+ This->ext->glDeleteBuffers(1, &This->buffer);
 50+ free(This);
 51+ }
 52+}
 53+
 54+void BufferObject_SetData(BufferObject *This, GLenum target, GLsizeiptr size, GLvoid *data, GLenum usage)
 55+{
 56+ if (This->ext->GLEXT_ARB_direct_state_access)
 57+ {
 58+ This->ext->glNamedBufferData(This->buffer, size, data, usage);
 59+ }
 60+ else if (This->ext->GLEXT_EXT_direct_state_access)
 61+ {
 62+ This->ext->glNamedBufferDataEXT(This->buffer, size, data, usage);
 63+ }
 64+ else
 65+ {
 66+ This->util->BindBuffer(This, target);
 67+ This->ext->glBufferData(target, size, data, usage);
 68+ This->util->UndoBindBuffer(target);
 69+ }
 70+}
 71+
 72+void BufferObject_Bind(BufferObject *This, GLenum target)
 73+{
 74+ This->util->BindBuffer(This, target);
 75+}
 76+void BufferObject_Unbind(BufferObject *This, GLenum target)
 77+{
 78+ This->util->BindBuffer(NULL, target);
 79+}
 80+
 81+void *BufferObject_Map(BufferObject *This, GLenum target, GLenum access)
 82+{
 83+ void *ptr;
 84+ if (This->ext->GLEXT_ARB_direct_state_access)
 85+ {
 86+ ptr = This->ext->glMapNamedBuffer(This->buffer, access);
 87+ }
 88+ else if (This->ext->GLEXT_EXT_direct_state_access)
 89+ {
 90+ ptr = This->ext->glMapNamedBufferEXT(This->buffer, access);
 91+ }
 92+ else
 93+ {
 94+ This->util->BindBuffer(This, target);
 95+ ptr = This->ext->glMapBuffer(target, access);
 96+ This->util->UndoBindBuffer(target);
 97+ }
 98+ return ptr;
 99+}
 100+GLboolean BufferObject_Unmap(BufferObject *This, GLenum target)
 101+{
 102+ GLboolean ret;
 103+ if (This->ext->GLEXT_ARB_direct_state_access)
 104+ {
 105+ ret = This->ext->glUnmapNamedBuffer(This->buffer);
 106+ }
 107+ else if (This->ext->GLEXT_EXT_direct_state_access)
 108+ {
 109+ ret = This->ext->glUnmapNamedBufferEXT(This->buffer);
 110+ }
 111+ else
 112+ {
 113+ This->util->BindBuffer(This, target);
 114+ ret = This->ext->glUnmapBuffer(target);
 115+ This->util->UndoBindBuffer(target);
 116+ }
 117+ return ret;
 118+}
 119+
 120+}
\ No newline at end of file
Index: ddraw/BufferObject.h
@@ -0,0 +1,57 @@
 2+// DXGL
 3+// Copyright (C) 2015 William Feely
 4+
 5+// This library is free software; you can redistribute it and/or
 6+// modify it under the terms of the GNU Lesser General Public
 7+// License as published by the Free Software Foundation; either
 8+// version 2.1 of the License, or (at your option) any later version.
 9+
 10+// This library is distributed in the hope that it will be useful,
 11+// but WITHOUT ANY W ARRANTY; without even the implied warranty of
 12+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 13+// Lesser General Public License for more details.
 14+
 15+// You should have received a copy of the GNU Lesser General Public
 16+// License along with this library; if not, write to the Free Software
 17+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 18+
 19+#pragma once
 20+#ifndef __PBO_H
 21+#define __PBO_H
 22+
 23+#ifdef __cplusplus
 24+extern "C" {
 25+#else
 26+typedef int glUtil;
 27+#endif
 28+
 29+
 30+typedef struct BufferObject
 31+{
 32+ ULONG refcount;
 33+ ULONG busy;
 34+ GLuint buffer;
 35+ GLsizei size;
 36+ void *pointer;
 37+ BOOL mapped;
 38+ BOOL bound;
 39+ BOOL target;
 40+ glExtensions *ext;
 41+ glUtil *util;
 42+} BufferObject;
 43+
 44+void BufferObject_Create(BufferObject **out, glExtensions *ext, glUtil *util);
 45+void BufferObject_AddRef(BufferObject *This);
 46+void BufferObject_Release(BufferObject *This);
 47+void BufferObject_SetData(BufferObject *This, GLenum target, GLsizeiptr size, GLvoid *data, GLenum usage);
 48+void BufferObject_Bind(BufferObject *This, GLenum target);
 49+void BufferObject_Unbind(BufferObject *This, GLenum target);
 50+void *BufferObject_Map(BufferObject *This, GLenum target, GLenum access);
 51+GLboolean BufferObject_Unmap(BufferObject *This, GLenum target);
 52+
 53+#ifdef __cplusplus
 54+}
 55+#endif
 56+
 57+
 58+#endif //__PBO_H
\ No newline at end of file
Index: ddraw/TextureManager.c
@@ -16,6 +16,7 @@
1717 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919 #include "common.h"
 20+#include "BufferObject.h"
2021 #include "TextureManager.h"
2122 #include <math.h>
2223
@@ -491,7 +492,8 @@
492493 texture->bordercolor = texture->format = texture->type = texture->width =
493494 texture->height = texture->magfilter = texture->minfilter =
494495 texture->miplevel = texture->wraps = texture->wrapt =
495 - texture->pbo = texture->id = 0;
 496+ texture->id = 0;
 497+ texture->pboPack = texture->pboUnpack = NULL;
496498 ZeroMemory(texture->internalformats, 8 * sizeof(GLint));
497499 }
498500
Index: ddraw/TextureManager.h
@@ -23,17 +23,9 @@
2424 extern "C" {
2525 #endif
2626
27 -typedef struct
28 -{
29 - ULONG refcount;
30 - GLuint buffer;
31 - GLsizei size;
32 - void *pointer;
33 - BOOL mapped;
34 - BOOL busy;
35 -} PBO;
 27+struct BufferObject;
3628
37 -typedef struct
 29+typedef struct TEXTURE
3830 {
3931 GLuint id;
4032 GLsizei width;
@@ -50,7 +42,8 @@
5143 int colororder;
5244 GLenum format;
5345 GLenum type;
54 - GLuint pbo;
 46+ BufferObject *pboPack;
 47+ BufferObject *pboUnpack;
5548 DDPIXELFORMAT pixelformat;
5649 } TEXTURE;
5750
Index: ddraw/common.h
@@ -106,6 +106,7 @@
107107 out[2] = (GLint)(in& 0xff);
108108 out[3] = (GLint)((in>>24) & 0xff);
109109 }
 110+#define BUFFER_OFFSET(i) ((char *)NULL + (i))
110111
111112 #ifdef _M_X64
112113 #define NextMultipleOfWord NextMultipleOf8
Index: ddraw/ddraw.vcxproj
@@ -294,6 +294,7 @@
295295 <ClInclude Include="include\GL\wglext.h" />
296296 <ClInclude Include="include\winedef.h" />
297297 <ClInclude Include="matrix.h" />
 298+ <ClInclude Include="BufferObject.h" />
298299 <ClInclude Include="resource.h" />
299300 <ClInclude Include="scalers.h" />
300301 <ClInclude Include="ShaderGen3D.h" />
@@ -383,6 +384,14 @@
384385 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'">NotUsing</PrecompiledHeader>
385386 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug No MSVCRT|Win32'">NotUsing</PrecompiledHeader>
386387 </ClCompile>
 388+ <ClCompile Include="BufferObject.cpp">
 389+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Trace|Win32'">NotUsing</PrecompiledHeader>
 390+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release no DXGL|Win32'">NotUsing</PrecompiledHeader>
 391+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
 392+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
 393+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'">NotUsing</PrecompiledHeader>
 394+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug No MSVCRT|Win32'">NotUsing</PrecompiledHeader>
 395+ </ClCompile>
387396 <ClCompile Include="precomp.cpp">
388397 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug no DXGL|Win32'">Create</PrecompiledHeader>
389398 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
Index: ddraw/ddraw.vcxproj.filters
@@ -146,6 +146,9 @@
147147 <ClInclude Include="hooks.h">
148148 <Filter>Header Files</Filter>
149149 </ClInclude>
 150+ <ClInclude Include="BufferObject.h">
 151+ <Filter>Header Files</Filter>
 152+ </ClInclude>
150153 </ItemGroup>
151154 <ItemGroup>
152155 <ClCompile Include="ddraw.cpp">
@@ -247,6 +250,9 @@
248251 <ClCompile Include="hooks.c">
249252 <Filter>Source Files</Filter>
250253 </ClCompile>
 254+ <ClCompile Include="BufferObject.cpp">
 255+ <Filter>Source Files</Filter>
 256+ </ClCompile>
251257 </ItemGroup>
252258 <ItemGroup>
253259 <ResourceCompile Include="ddraw.rc">
Index: ddraw/glExtensions.c
@@ -155,6 +155,9 @@
156156 ext->glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)wglGetProcAddress("glGetTextureImageEXT");
157157 ext->glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)wglGetProcAddress("glMatrixLoadfEXT");
158158 ext->glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)wglGetProcAddress("glMatrixMultfEXT");
 159+ ext->glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)wglGetProcAddress("glNamedBufferDataEXT");
 160+ ext->glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)wglGetProcAddress("glMapNamedBufferEXT");
 161+ ext->glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)wglGetProcAddress("glUnmapNamedBufferEXT");
159162 }
160163 if (ext->GLEXT_ARB_direct_state_access)
161164 {
@@ -164,6 +167,9 @@
165168 ext->glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)wglGetProcAddress("glTextureParameteriv");
166169 ext->glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)wglGetProcAddress("glTextureSubImage2D");
167170 ext->glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)wglGetProcAddress("glGetTextureImage");
 171+ ext->glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)wglGetProcAddress("glNamedBufferData");
 172+ ext->glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)wglGetProcAddress("glMapNamedBuffer");
 173+ ext->glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)wglGetProcAddress("glUnmapNamedBuffer");
168174 }
169175 if (ext->GLEXT_ARB_sampler_objects)
170176 {
Index: ddraw/glExtensions.h
@@ -114,6 +114,9 @@
115115 void (APIENTRY *glGetTextureImageEXT)(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
116116 void (APIENTRY *glMatrixLoadfEXT)(GLenum mode, const GLfloat *m);
117117 void (APIENTRY *glMatrixMultfEXT)(GLenum mode, const GLfloat *m);
 118+ void (APIENTRY *glNamedBufferDataEXT)(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
 119+ void* (APIENTRY *glMapNamedBufferEXT)(GLuint buffer, GLenum access);
 120+ GLboolean (APIENTRY *glUnmapNamedBufferEXT)(GLuint buffer);
118121
119122 void (APIENTRY *glTextureParameterf)(GLuint texture, GLenum pname, GLfloat param);
120123 void (APIENTRY *glTextureParameterfv)(GLuint texture, GLenum pname, const GLfloat *params);
@@ -122,8 +125,10 @@
123126 void (APIENTRY *glTextureSubImage2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset,
124127 GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
125128 void (APIENTRY *glGetTextureImage)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels);
 129+ void (APIENTRY *glNamedBufferData)(GLuint buffer, GLsizei size, const void *data, GLenum usage);
 130+ void* (APIENTRY *glMapNamedBuffer)(GLuint buffer, GLenum access);
 131+ GLboolean (APIENTRY *glUnmapNamedBuffer)(GLuint buffer);
126132
127 -
128133 void (APIENTRY *glBindSampler)(GLuint unit, GLuint sampler);
129134 void (APIENTRY *glDeleteSamplers)(GLsizei n, const GLuint *samplers);
130135 void (APIENTRY *glGenSamplers)(GLsizei n, GLuint *samplers);
Index: ddraw/glRenderer.cpp
@@ -16,6 +16,7 @@
1717 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919 #include "common.h"
 20+#include "BufferObject.h"
2021 #include "TextureManager.h"
2122 #include "glUtil.h"
2223 #include "timer.h"
@@ -212,7 +213,7 @@
213214 This->backbuffer = NULL;
214215 This->hDC = NULL;
215216 This->hRC = NULL;
216 - This->PBO = 0;
 217+ This->pbo = NULL;
217218 This->dib.enabled = false;
218219 This->hWnd = hwnd;
219220 InitializeCriticalSection(&This->cs);
@@ -889,11 +890,10 @@
890891 }
891892 TextureManager_DeleteSamplers(This->texman);
892893 This->util->DeleteFBO(&This->fbo);
893 - if(This->PBO)
 894+ if(This->pbo)
894895 {
895 - This->ext->glBindBuffer(GL_PIXEL_PACK_BUFFER,0);
896 - This->ext->glDeleteBuffers(1,&This->PBO);
897 - This->PBO = 0;
 896+ BufferObject_Release(This->pbo);
 897+ This->pbo = NULL;
898898 }
899899 if(This->backbuffer)
900900 {
@@ -1149,10 +1149,8 @@
11501150 This->dib.hbitmap = CreateDIBSection(This->dib.hdc,&This->dib.info,
11511151 DIB_RGB_COLORS,(void**)&This->dib.pixels,NULL,0);
11521152 }
1153 - This->ext->glGenBuffers(1,&This->PBO);
1154 - This->ext->glBindBuffer(GL_PIXEL_PACK_BUFFER,This->PBO);
1155 - This->ext->glBufferData(GL_PIXEL_PACK_BUFFER,width*height*4,NULL,GL_STREAM_READ);
1156 - This->ext->glBindBuffer(GL_PIXEL_PACK_BUFFER,0);
 1153+ BufferObject_Create(&This->pbo, This->ext, This->util);
 1154+ BufferObject_SetData(This->pbo, GL_PIXEL_PACK_BUFFER, width*height * 4, NULL, GL_STREAM_READ);
11571155 TextureManager_InitSamplers(This->texman);
11581156 TRACE_SYSINFO();
11591157 return TRUE;
@@ -1759,20 +1757,21 @@
17601758 else
17611759 {
17621760 glReadBuffer(GL_FRONT);
1763 - This->ext->glBindBuffer(GL_PIXEL_PACK_BUFFER,This->PBO);
 1761+ BufferObject_Bind(This->pbo, GL_PIXEL_PACK_BUFFER);
17641762 GLint packalign;
17651763 glGetIntegerv(GL_PACK_ALIGNMENT,&packalign);
17661764 glPixelStorei(GL_PACK_ALIGNMENT,1);
17671765 This->ddInterface->GetSizes(sizes);
17681766 glReadPixels(0,0,sizes[4],sizes[5],GL_BGRA,GL_UNSIGNED_BYTE,0);
1769 - GLubyte *pixels = (GLubyte*)This->ext->glMapBuffer(GL_PIXEL_PACK_BUFFER,GL_READ_ONLY);
 1767+ BufferObject_Map(This->pbo, GL_PIXEL_PACK_BUFFER, GL_READ_ONLY);
 1768+ GLubyte *pixels = (GLubyte*)This->pbo->pointer;
17701769 for(int i = 0; i < sizes[5];i++)
17711770 {
17721771 memcpy(&This->dib.pixels[This->dib.pitch*i],
17731772 &pixels[((sizes[5]-1)-i)*(sizes[4]*4)],sizes[4]*4);
17741773 }
1775 - This->ext->glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
1776 - This->ext->glBindBuffer(GL_PIXEL_PACK_BUFFER,0);
 1774+ BufferObject_Unmap(This->pbo, GL_PIXEL_PACK_BUFFER);
 1775+ BufferObject_Unbind(This->pbo, GL_PIXEL_PACK_BUFFER);
17771776 glPixelStorei(GL_PACK_ALIGNMENT,packalign);
17781777 HDC hRenderDC = (HDC)::GetDC(This->RenderWnd->GetHWnd());
17791778 HGDIOBJ hPrevObj = 0;
Index: ddraw/glRenderer.h
@@ -137,7 +137,7 @@
138138 glRenderWindow *RenderWnd;
139139 DIB dib;
140140 FBO fbo;
141 - GLuint PBO;
 141+ BufferObject *pbo;
142142 CRITICAL_SECTION cs;
143143 HANDLE busy;
144144 HANDLE start;
Index: ddraw/glUtil.cpp
@@ -18,6 +18,7 @@
1919 #include "common.h"
2020 #include "TextureManager.h"
2121 #include "glUtil.h"
 22+#include "BufferObject.h"
2223 #include "glDirectDrawSurface.h"
2324
2425 glUtil::glUtil(glExtensions *glext)
@@ -60,6 +61,8 @@
6162 cullenabled = false;
6263 polymode = D3DFILL_SOLID;
6364 shademode = D3DSHADE_GOURAUD;
 65+ pboPackBinding = pboUnpackBinding = vboArrayBinding =
 66+ vboElementArrayBinding = uboUniformBufferBinding = LastBoundBuffer = NULL;
6467 }
6568 void glUtil::InitFBO(FBO *fbo)
6669 {
@@ -522,4 +525,42 @@
523526 break;
524527 }
525528 }
 529+}
 530+
 531+void glUtil::BindBuffer(BufferObject *buffer, GLenum target)
 532+{
 533+ switch (target)
 534+ {
 535+ case GL_PIXEL_PACK_BUFFER:
 536+ LastBoundBuffer = pboPackBinding;
 537+ pboPackBinding = buffer;
 538+ break;
 539+ case GL_PIXEL_UNPACK_BUFFER:
 540+ LastBoundBuffer = pboUnpackBinding;
 541+ pboUnpackBinding = buffer;
 542+ break;
 543+ case GL_ARRAY_BUFFER:
 544+ LastBoundBuffer = vboArrayBinding;
 545+ vboArrayBinding = buffer;
 546+ break;
 547+ case GL_ELEMENT_ARRAY_BUFFER:
 548+ LastBoundBuffer = vboElementArrayBinding;
 549+ vboElementArrayBinding = buffer;
 550+ break;
 551+ case GL_UNIFORM_BUFFER:
 552+ LastBoundBuffer = uboUniformBufferBinding;
 553+ uboUniformBufferBinding = buffer;
 554+ break;
 555+ default:
 556+ LastBoundBuffer = NULL;
 557+ }
 558+ if(buffer) ext->glBindBuffer(target, buffer->buffer);
 559+ else ext->glBindBuffer(target, 0);
 560+}
 561+
 562+void glUtil::UndoBindBuffer(GLenum target)
 563+{
 564+ if (LastBoundBuffer) ext->glBindBuffer(target, LastBoundBuffer->buffer);
 565+ else ext->glBindBuffer(target, 0);
 566+ LastBoundBuffer = NULL;
526567 }
\ No newline at end of file
Index: ddraw/glUtil.h
@@ -19,6 +19,10 @@
2020 #ifndef _GLUTIL_H
2121 #define _GLUTIL_H
2222
 23+struct TEXTURE;
 24+struct BufferObject;
 25+struct TextureManager;
 26+
2327 typedef struct
2428 {
2529 GLuint fbo;
@@ -68,7 +72,14 @@
6973 void SetCull(D3DCULL mode);
7074 void SetPolyMode(D3DFILLMODE mode);
7175 void SetShadeMode(D3DSHADEMODE mode);
 76+ void BindBuffer(BufferObject *buffer, GLenum target);
 77+ void UndoBindBuffer(GLenum target);
7278 FBO *currentfbo;
 79+ BufferObject *pboPackBinding;
 80+ BufferObject *pboUnpackBinding;
 81+ BufferObject *vboArrayBinding;
 82+ BufferObject *vboElementArrayBinding;
 83+ BufferObject *uboUniformBufferBinding;
7384 private:
7485 glExtensions *ext;
7586 bool depthwrite;
@@ -107,6 +118,7 @@
108119 bool cullenabled;
109120 D3DFILLMODE polymode;
110121 D3DSHADEMODE shademode;
 122+ BufferObject *LastBoundBuffer;
111123 };
112124
113125 #endif //_GLUTIL_H