Windows OpenGL port Complete

It helps to actually remember to call glewInit() on MSW :)
This commit is contained in:
Mark Watkins 2011-06-15 13:27:56 +10:00
parent aed08178d4
commit d13a5d40fa
5 changed files with 29 additions and 20 deletions

View File

@ -8309,7 +8309,7 @@
1308026543 D
1308106147 /home/mark/projects/git/sleepyhead/src/version.h
1308108253 /home/mark/projects/git/sleepyhead/src/version.h
1308003040 ent of cb2ab33... Linux wx2.8 & wx2.9 builds fixed
<wx/dcbuffer.h>
@ -8361,7 +8361,7 @@
"sleeplib/profiles.h"
"sleeplib/machine_loader.h"
1308104848 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
1308106542 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
"freetype-gl/font-manager.h"
"freetype-gl/texture-font.h"
"graph.h"
@ -11046,7 +11046,7 @@
<GL/glew.h>
"texture-glyph.h"
1308032101 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vertex-buffer.cpp
1308107127 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vertex-buffer.cpp
<assert.h>
<string.h>
<stdlib.h>
@ -11067,7 +11067,7 @@
<AGL/agl.h>
<GL/glx.h>
1308100135 source:/home/mark/projects/git/sleepyhead/src/graphs/gl_pbuffer.cpp
1308106486 source:/home/mark/projects/git/sleepyhead/src/graphs/gl_pbuffer.cpp
"gl_pbuffer.h"
<wx/utils.h>

View File

@ -133,7 +133,7 @@ pBufferWGL::pBufferWGL(int width, int height)
// compare w & h to m_width & m_height.
wglMakeCurrent(hdc,hGlRc);
/* wglMakeCurrent(hdc,hGlRc);
glEnable(GL_TEXTURE_2D); // Enable Texture Mapping
glEnable(GL_BLEND);
@ -146,7 +146,7 @@ pBufferWGL::pBufferWGL(int width, int height)
glLoadIdentity();
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT); */
// switch back to the screen context
@ -174,7 +174,9 @@ void pBufferWGL::UseBuffer(bool b)
bool pBufferWGL::InitGLStuff()
{
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
// Technically don't need this wrangling with glewInit being actually called now....
//wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
char *ext = NULL;
if (wglGetExtensionsStringARB)
@ -188,11 +190,11 @@ bool pBufferWGL::InitGLStuff()
wxLogError(wxT("WGL_ARB_pbuffer extension was not found"));
return false;
} else {
wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)wglGetProcAddress("wglCreatePbufferARB");
wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)wglGetProcAddress("wglGetPbufferDCARB");
wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)wglGetProcAddress("wglReleasePbufferDCARB");
wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)wglGetProcAddress("wglDestroyPbufferARB");
wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)wglGetProcAddress("wglQueryPbufferARB");
//wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)wglGetProcAddress("wglCreatePbufferARB");
//wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)wglGetProcAddress("wglGetPbufferDCARB");
//wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)wglGetProcAddress("wglReleasePbufferDCARB");
//wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)wglGetProcAddress("wglDestroyPbufferARB");
//wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)wglGetProcAddress("wglQueryPbufferARB");
if (!wglCreatePbufferARB || !wglGetPbufferDCARB || !wglReleasePbufferDCARB ||
!wglDestroyPbufferARB || !wglQueryPbufferARB) {

View File

@ -64,6 +64,10 @@ TextMarkup *markup=NULL;
// Must be called from a thread inside the application.
void GraphInit()
{
#if defined(__WXMSW__)
glewInit(); // Dont forget this nasty little sucker.. :)
#endif
if (!gfont_init) {
font_manager=new FontManager();
vbuffer=new VertexBuffer((char *)"v3i:t2f:c4f");
@ -134,9 +138,7 @@ void DrawText2(wxString text, float x, float y,TextureFont *font)
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glEnable( GL_TEXTURE_2D );
glColor4f(1,1,1,1);
#if !defined(__WXMSW__)
vbuffer->Render(GL_TRIANGLES, (char *)"vtc" );
#endif
glDisable(GL_BLEND);
}

View File

@ -107,6 +107,11 @@ VertexBuffer::~VertexBuffer()
void VertexBuffer::Upload()
{
if (!glGenBuffers) {
printf("WHAT???");
assert(false);
return;
}
if (!vertices_id) {
glGenBuffers(1, &vertices_id);
}

View File

@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type
static const long _MAJOR = 0;
static const long _MINOR = 7;
static const long _BUILD = 5910;
static const long _REVISION = 15610;
static const long _BUILD = 5918;
static const long _REVISION = 15644;
//Miscellaneous Version Types
static const long _BUILDS_COUNT = 6353;
#define _RC_FILEVERSION 0,7,5910,15610
#define _RC_FILEVERSION_STRING "0, 7, 5910, 15610\0"
static const char _FULLVERSION_STRING[] = "0.7.5910.15610";
static const long _BUILDS_COUNT = 6363;
#define _RC_FILEVERSION 0,7,5918,15644
#define _RC_FILEVERSION_STRING "0, 7, 5918, 15644\0"
static const char _FULLVERSION_STRING[] = "0.7.5918.15644";
//These values are to keep track of your versioning state, don't modify them.
static const long _BUILD_HISTORY = 0;