- merging in changes from weltall for macosx

This commit is contained in:
Mark Vejvoda
2011-10-18 01:13:38 +00:00
parent fa5aea7e42
commit 5b7329594c
14 changed files with 60 additions and 37 deletions

View File

@@ -32,7 +32,7 @@ void Font2DGl::init() {
handle= glGenLists(charCount);
assertGl();
createGlFontBitmaps(handle, type, size, width, charCount, metrics);
createGlFontBitmaps((Shared::Platform::uint32&)handle, type, size, width, charCount, metrics);
assertGl();
}
inited= true;
@@ -60,7 +60,7 @@ void Font3DGl::init() {
if(getTextHandler() == NULL) {
assertGl();
handle= glGenLists(charCount);
createGlFontOutlines(handle, type, width, depth, charCount, metrics);
createGlFontOutlines((Shared::Platform::uint32&)handle, type, width, depth, charCount, metrics);
assertGl();
}
inited= true;

View File

@@ -234,7 +234,6 @@ void TextFTGL::Render(const char* str, const int len) {
if(len != 0) {
//printf("FTGL Render [%s] facesize = %d\n",str,ftFont->FaceSize());
assertGl();
ftFont->Render(str, len);
//assertGl();
GLenum error = glGetError();

View File

@@ -139,31 +139,31 @@ const char *getGlPlatformExtensions() {
int getGlMaxLights() {
int i;
glGetIntegerv(GL_MAX_LIGHTS, &i);
glGetIntegerv(GL_MAX_LIGHTS, (GLint*)&i);
return i;
}
int getGlMaxTextureSize() {
int i;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &i);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&i);
return i;
}
int getGlMaxTextureUnits() {
int i;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i);
glGetIntegerv(GL_MAX_TEXTURE_UNITS, (GLint*)&i);
return i;
}
int getGlModelviewMatrixStackDepth() {
int i;
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &i);
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, (GLint*)&i);
return i;
}
int getGlProjectionMatrixStackDepth() {
int i;
glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, &i);
glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, (GLint*)&i);
return i;
}

View File

@@ -340,7 +340,7 @@ static std::string getSupportCompressedTextureFormatString(int format) {
static int getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, (GLint*)&numCompressedTextureFormats);
return numCompressedTextureFormats;
}
@@ -349,7 +349,7 @@ static std::vector<int> getSupportCompressedTextureFormats() {
int count = getNumCompressedTextureFormats();
if(count > 0) {
int *formats = new int[count];
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS,&formats[0]);
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS,(GLint*)&formats[0]);
for(int i = 0; i < count; ++i) {
result.push_back(formats[i]);

View File

@@ -138,28 +138,28 @@ void Mesh::BuildVBOs() {
//printf("In [%s::%s Line: %d] setting up a VBO...\n",__FILE__,__FUNCTION__,__LINE__);
// Generate And Bind The Vertex Buffer
glGenBuffersARB( 1, &m_nVBOVertices ); // Get A Valid Name
glGenBuffersARB( 1,(GLuint*) &m_nVBOVertices ); // Get A Valid Name
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOVertices ); // Bind The Buffer
// Load The Data
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getVertices(), GL_STATIC_DRAW_ARB );
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
// Generate And Bind The Texture Coordinate Buffer
glGenBuffersARB( 1, &m_nVBOTexCoords ); // Get A Valid Name
glGenBuffersARB( 1, (GLuint*)&m_nVBOTexCoords ); // Get A Valid Name
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOTexCoords ); // Bind The Buffer
// Load The Data
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec2f)*vertexCount, texCoords, GL_STATIC_DRAW_ARB );
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
// Generate And Bind The Normal Buffer
glGenBuffersARB( 1, &m_nVBONormals ); // Get A Valid Name
glGenBuffersARB( 1, (GLuint*)&m_nVBONormals ); // Get A Valid Name
glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBONormals ); // Bind The Buffer
// Load The Data
glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getNormals(), GL_STATIC_DRAW_ARB );
glBindBuffer(GL_ARRAY_BUFFER_ARB, 0);
// Generate And Bind The Index Buffer
glGenBuffersARB( 1, &m_nVBOIndexes ); // Get A Valid Name
glGenBuffersARB( 1, (GLuint*)&m_nVBOIndexes ); // Get A Valid Name
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, m_nVBOIndexes ); // Bind The Buffer
// Load The Data
glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(uint32)*indexCount, indices, GL_STATIC_DRAW_ARB );
@@ -182,10 +182,10 @@ void Mesh::BuildVBOs() {
void Mesh::ReleaseVBOs() {
if(getVBOSupported() == true) {
if(hasBuiltVBOs == true) {
glDeleteBuffersARB( 1, &m_nVBOVertices ); // Get A Valid Name
glDeleteBuffersARB( 1, &m_nVBOTexCoords ); // Get A Valid Name
glDeleteBuffersARB( 1, &m_nVBONormals ); // Get A Valid Name
glDeleteBuffersARB( 1, &m_nVBOIndexes ); // Get A Valid Name
glDeleteBuffersARB( 1, (GLuint*)&m_nVBOVertices ); // Get A Valid Name
glDeleteBuffersARB( 1, (GLuint*)&m_nVBOTexCoords ); // Get A Valid Name
glDeleteBuffersARB( 1, (GLuint*)&m_nVBONormals ); // Get A Valid Name
glDeleteBuffersARB( 1, (GLuint*)&m_nVBOIndexes ); // Get A Valid Name
hasBuiltVBOs = false;
}
}

View File

@@ -60,6 +60,10 @@
#include "utf8.h"
#include "leak_dumper.h"
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
using namespace Shared::Platform;
using namespace Shared::Util;
using namespace std;

View File

@@ -18,7 +18,7 @@
#include "sdl_private.h"
#include "noimpl.h"
#include "util.h"
#include "window.h"
//#include "window.h"
#include <vector>
//#include <SDL_image.h>
#include "leak_dumper.h"

View File

@@ -4,6 +4,11 @@
* copyright (c) 2005-2011 Thomas Bernard
* This software is subjet to the conditions detailed in the
* provided LICENSE file. */
#if defined(__APPLE__)
#define MACOSX 1
#define _DARWIN_C_SOURCE 1
#endif
#define __EXTENSIONS__ 1
#if !defined(MACOSX) && !defined(__sun)
#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__)

View File

@@ -31,7 +31,7 @@ namespace Shared { namespace Platform {
// ======================================
// Global Fcs
// ======================================
#if !defined(__APPLE__)
void createGlFontBitmaps(uint32 &base, const string &type, int size, int width,
int charCount, FontMetrics &metrics) {
@@ -155,5 +155,6 @@ void createGlFontOutlines(uint32 &base, const string &type, int width,
NOIMPL;
}
#endif
}}//end namespace