Fixes Windows compile errors

This commit is contained in:
Mark Watkins 2011-06-14 19:51:05 +10:00
parent abd0a0cff7
commit 0254fb199d
9 changed files with 420 additions and 373 deletions

View File

@ -45,16 +45,18 @@
<Compiler>
<Add option="-march=i686" />
<Add option="-O2" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --cflags`" />
<Add option="-I/usr/include/freetype2" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --cflags`" />
<Add option="-Dd" />
<Add directory="../../src/libs" />
<Add directory="../../src" />
</Compiler>
<Linker>
<Add option="-s" />
<Add option="-lftgl" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --libs gl,richtext,aui,xrc,qa,html,adv,core,xml,net,base`" />
<Add option="-lfreetype" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --libs richtext,aui,xrc,qa,html,adv,core,xml,net,base,gl`" />
<Add option="-lglew32s" />
<Add option="-lopengl32" />
<Add option="-lgdiplus" />
</Linker>
</Target>
@ -162,7 +164,6 @@
<Unit filename="../../src/libs/tinyxml/tinyxml.h" />
<Unit filename="../../src/libs/tinyxml/tinyxmlerror.cpp" />
<Unit filename="../../src/libs/tinyxml/tinyxmlparser.cpp" />
<Unit filename="../../src/version.h" />
<Extensions>
<code_completion />
<envvars />
@ -170,9 +171,9 @@
<lib_finder disable_auto="1" />
<AutoVersioning>
<Scheme minor_max="10" build_max="0" rev_max="0" rev_rand_max="10" build_times_to_increment_minor="300" />
<Settings autoincrement="0" date_declarations="1" do_auto_increment="1" ask_to_increment="0" language="C++" svn="0" svn_directory="" header_path="../../src/version.h" />
<Settings autoincrement="0" date_declarations="1" do_auto_increment="1" ask_to_increment="0" language="C++" svn="0" svn_directory=" " header_path="../../src/version.h" />
<Changes_Log show_changes_editor="0" app_title="released version %M.%m.%b of %p" changeslog_path="ChangesLog.txt" />
<Code header_guard="VERSION_H" namespace="AutoVersion" prefix="" />
<Code header_guard="VERSION_H" namespace="AutoVersion" prefix=" " />
</AutoVersioning>
<wxsmith version="1">
<gui name="wxWidgets" src="" main="" init_handlers="necessary" language="CPP" />

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug-wx29" />
<ActiveTarget name="Windows" />
<File name="../../src/GUIFrame.cpp" open="0" top="0" tabpos="11">
<Cursor position="1318" topLine="9" />
</File>
@ -8,10 +8,10 @@
<Cursor position="3128" topLine="50" />
</File>
<File name="../../src/SleepyHeadApp.cpp" open="1" top="0" tabpos="1">
<Cursor position="1042" topLine="16" />
<Cursor position="1743" topLine="43" />
</File>
<File name="../../src/SleepyHeadMain.cpp" open="1" top="0" tabpos="2">
<Cursor position="29214" topLine="757" />
<Cursor position="8658" topLine="272" />
</File>
<File name="../../src/SleepyHeadMain.h" open="1" top="0" tabpos="3">
<Cursor position="2630" topLine="75" />
@ -20,13 +20,13 @@
<Cursor position="0" topLine="0" />
</File>
<File name="../../src/graphs/graph.cpp" open="1" top="0" tabpos="7">
<Cursor position="0" topLine="0" />
<Cursor position="324" topLine="0" />
</File>
<File name="../../src/graphs/graph.h" open="1" top="0" tabpos="8">
<Cursor position="12163" topLine="323" />
</File>
<File name="../../src/libs/freetype-gl/font-manager.cpp" open="1" top="0" tabpos="9">
<Cursor position="0" topLine="30" />
<Cursor position="0" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/font-manager.h" open="1" top="0" tabpos="14">
<Cursor position="1954" topLine="5" />
@ -38,28 +38,28 @@
<Cursor position="1629" topLine="21" />
</File>
<File name="../../src/libs/freetype-gl/texture-font.cpp" open="1" top="0" tabpos="11">
<Cursor position="3837" topLine="106" />
<Cursor position="482" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/texture-font.h" open="1" top="0" tabpos="12">
<Cursor position="0" topLine="9" />
</File>
<File name="../../src/libs/freetype-gl/texture-glyph.cpp" open="1" top="0" tabpos="15">
<Cursor position="0" topLine="69" />
<Cursor position="1328" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/texture-glyph.h" open="1" top="0" tabpos="16">
<Cursor position="0" topLine="19" />
</File>
<File name="../../src/libs/freetype-gl/vector.cpp" open="0" top="0" tabpos="13">
<Cursor position="1187" topLine="18" />
<File name="../../src/libs/freetype-gl/vector.cpp" open="1" top="0" tabpos="19">
<Cursor position="0" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/vector.h" open="0" top="0" tabpos="14">
<Cursor position="0" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/vertex-buffer.cpp" open="1" top="0" tabpos="17">
<Cursor position="2573" topLine="131" />
<Cursor position="653" topLine="0" />
</File>
<File name="../../src/libs/freetype-gl/vertex-buffer.h" open="1" top="0" tabpos="18">
<Cursor position="3491" topLine="54" />
<File name="../../src/libs/freetype-gl/vertex-buffer.h" open="1" top="1" tabpos="18">
<Cursor position="1412" topLine="12" />
</File>
<File name="../../src/libs/sleeplib/binary_file.cpp" open="0" top="0" tabpos="11">
<Cursor position="7148" topLine="269" />
@ -94,7 +94,4 @@
<File name="../../src/libs/sleeplib/prs1_loader.h" open="0" top="0" tabpos="11">
<Cursor position="622" topLine="0" />
</File>
<File name="../../src/version.h" open="1" top="1" tabpos="19">
<Cursor position="586" topLine="0" />
</File>
</CodeBlocks_layout_file>

View File

@ -5,19 +5,10 @@ Author: Mark Watkins <jedimark64@users.sourceforge.net>
License: LGPL
*/
#define GL_GLEXT_PROTOTYPES
#ifdef __DARWIN__
#include <OpenGL/gl.h>
#include <AGL/agl.h>
#elif defined(__WXMSW__)
#define GLEW_STATIC
#include <GL/glew.h>
#endif
#include <wx/dcbuffer.h>
#include <wx/glcanvas.h>
//#include <wx/glcanvas.h>
#include <wx/settings.h>
#include <wx/graphics.h>
@ -335,7 +326,7 @@ END_EVENT_TABLE()
static int wx_gl_attribs[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 24, 0};
gGraphWindow::gGraphWindow()
: wxGLCanvas( (wxWindow *)NULL,(wxGLContext *)NULL,wxID_ANY) //,wxDefaultPosition,wxDefaultSize,wxT("GLContext"),(int *)wx_gl_attribs,wxNullPalette)
: wxGLCanvas( (wxWindow *)NULL,shared_context,wxID_ANY) //,wxDefaultPosition,wxDefaultSize,wxT("GLContext"),(int *)wx_gl_attribs,wxNullPalette)
{
}
@ -822,13 +813,12 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
//pBuffers are evil.. but I need to use them here.
#if defined(__WXMSW__)
/*#define MAX_ATTRIBS 8
HDC hDC = wglGetCurrentDC();
// Get ready to query for a suitable pixel format that meets our minimum requirements.
/*int iAttributes[2*MAX_ATTRIBS];
int iAttributes[2*MAX_ATTRIBS];
float fAttributes[2*MAX_ATTRIBS];
int nfAttribs = 0;
int niAttribs = 0;
@ -877,7 +867,7 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
for (i=0; i<2*MAX_ATTRIBS; i++ )iAttributes[i] = 0;
g_hPBuffer=wglCreatePbufferARB( hDC, pformat, PBUFFERSIZE, PBUFFERSIZE, iAttributes );
HPBUFFERARB g_hPBuffer=wglCreatePbufferARB( hDC, pformat, PBUFFERSIZE, PBUFFERSIZE, iAttributes );
g_hPBufDC=wglGetPbufferDCARB( g_hPBuffer );
int w,h;
@ -887,11 +877,7 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
g_hPBufRC=wglCreateContext(g_hPBufDC);
return true; */
*/
// WGL pBuffer Implementation
return &wxNullBitmap;
#elif defined(__WXMAC__) || defined(__WXDARWIN__)
@ -912,15 +898,27 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
#if wxCHECK_VERSION(2,9,0)
display=wxGetX11Display();
fbc = GetGLXFBConfig();
fbc = &fbc[0];
#else
display=(Display *)wxGetDisplay();
int doubleBufferAttributess[] = {
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DOUBLEBUFFER, True,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
None
};
fbc=glXChooseFBConfig(display, DefaultScreen(display), doubleBufferAttributess, &ret);
// TODO:
// have to setup a GLXFBConfig structure for wx2.8 because wx2.8 is crap.
// already done this crap but deleted it.. arggghh.....
return &wxNullBitmap;
// return &wxNullBitmap;
#endif
GLXPbuffer pBuffer=glXCreatePbuffer(display, fbc[0], attrib );
GLXPbuffer pBuffer=glXCreatePbuffer(display, *fbc, attrib );
if (pBuffer == 0) {
wxLogError(wxT("pBuffer not availble"));
}
@ -933,19 +931,18 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
if (!cx && real_shared_context) cx=real_shared_context; // Only available after redraw.. :(
else {
// First render screws up unless we do this..
gx=cx = glXCreateNewContext(display,fbc[0],GLX_RGBA_TYPE, NULL, True);
gx=cx = glXCreateNewContext(display,*fbc,GLX_RGBA_TYPE, NULL, True);
}
//real_shared_context =
//GLXContext cx=real_shared_context;
if (cx == 0) {
wxLogError(wxT("CX not availble"));
}
//XFree(fbc);
#if wxCHECK_VERSION(2,9,0)
XFree(fbc);
#endif
if (glXMakeCurrent(display,pBuffer,cx)!=True) {
wxLogError(wxT("Couldn't make buffer current"));
}
@ -2029,7 +2026,26 @@ gLineOverlayBar::gLineOverlayBar(gPointData *d,const wxColor * col,wxString _lab
gLineOverlayBar::~gLineOverlayBar()
{
}
//nov = number of vertex
//r = radius
void Dot(int nov, float r)
{
if (nov < 4) nov = 4;
if (nov > 360) nov = 360;
float angle = (360/nov)*(3.142159/180);
float x[360] = {0};
float y[360] = {0};
for (int i = 0; i < nov; i++){
x[i] = cosf(r*cosf(i*angle));
y[i] = sinf(r*sinf(i*angle));
glBegin(GL_POLYGON);
for (int i = 0; i < nov; i++){
glVertex2f(x[i],y[i]);
}
glEnd();
}
//render to texture and map to GL_POINT_SPRITE
}
void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
{
if (!m_visible) return;
@ -2086,8 +2102,13 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
}
glEnd();
//glEnable(GL_POINT_SPRITE);
// Draw the dots above
glPointSize(6);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Dot(100,50);
glPointSize(5);
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glBegin(GL_POINTS);
for (int i=fi;i<li;i++) {
wxPoint2DDouble & rp=data->point[n][i];
@ -2097,6 +2118,8 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
}
}
glEnd();
glDisable(GL_POINT_SMOOTH);
//glDisable(GL_POINT_SPRITE);
// Text Labels & Spans
for (int i=fi;i<li;i++) {
@ -2114,9 +2137,9 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
}
}
} else if (lo_type==LOT_Dot) {
//glEnable(GL_POINT_SMOOTH);
//glEnable(GL_BLEND);
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glPointSize(4);
glBegin(GL_POINTS);
for (int i=fi;i<li;i++) {
@ -2126,7 +2149,7 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
glVertex2f(x1,start_py+(height/2)+14);
}
glEnd();
//glDisable(GL_POINT_SMOOTH);
glDisable(GL_POINT_SMOOTH);
//glDisable(GL_BLEND);
}
}

View File

@ -7,6 +7,26 @@ License: LGPL
#ifndef GRAPH_H
#define GRAPH_H
#define GL_GLEXT_PROTOTYPES
//#define _UNICODE 1
#ifdef __DARWIN__
#include <OpenGL/gl.h>
#include <AGL/agl.h>
#elif defined(__WXMSW__)
#define GLEW_STATIC
#define WGL_WGLEXT_PROTOTYPES
//#include <windows.h>
#include <GL/glew.h>
#include <GL/wglew.h>
//#include <GL/freeglut_std.h>
//#include <GL/freeglut_ext.h>
// windows gl extensions
#endif
#undef Yield
#include <wx/dcgraph.h>
#include <wx/glcanvas.h>

View File

@ -23,12 +23,16 @@
#if defined(__APPLE__)
#include <Glut/glut.h>
#elif defined(__WXMSW__)
#define GL_GLEXT_PROTOTYPES
#define GLEW_STATIC
#define _UNICODE 1
#include <GL/glew.h>
#else
#include <GL/gl.h>
#endif
//#include <GL/wglew.h>
//#else
// #include <GL/gl.h>
#endif
//#include <assert.h>
//#include <stdlib.h>
#include "texture-glyph.h"

View File

@ -23,7 +23,7 @@
#ifndef __TEXTURE_GLYPH_H__
#define __TEXTURE_GLYPH_H__
#include <wchar.h>
//#include <wchar.h>
#include "text-markup.h"
#include "vertex-buffer.h"

View File

@ -31,7 +31,9 @@
#include <Glut/glut.h>
#elif defined(__WXMSW__)
#define GLEW_STATIC
//#include <GL/freeglut_ext.h>
#include <GL/glew.h>
#include <GL/wglew.h>
#else
//#include <GL/glut.h>

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 = 5659;
static const long _REVISION = 14237;
static const long _BUILD = 5717;
static const long _REVISION = 14559;
//Miscellaneous Version Types
static const long _BUILDS_COUNT = 5892;
#define _RC_FILEVERSION 0,7,5659,14237
#define _RC_FILEVERSION_STRING "0, 7, 5659, 14237\0"
static const char _FULLVERSION_STRING[] = "0.7.5659.14237";
static const long _BUILDS_COUNT = 6004;
#define _RC_FILEVERSION 0,7,5717,14559
#define _RC_FILEVERSION_STRING "0, 7, 5717, 14559\0"
static const char _FULLVERSION_STRING[] = "0.7.5717.14559";
//These values are to keep track of your versioning state, don't modify them.
static const long _BUILD_HISTORY = 0;