mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +02:00
- merging in changes from weltall for macosx
This commit is contained in:
@@ -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;
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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]);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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"
|
||||
|
@@ -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__)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user