Skip to content
Snippets Groups Projects
Commit 0c3bc05f authored by dg's avatar dg
Browse files

mac port

git-svn-id: http://svn.net-core.org/repos/t-engine4@111 51575b47-30f0-44d4-a5cc-537603b46e54
parent d1804225
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ solution "TEngine"
"src/physfs",
"src/physfs/zlib123",
"/usr/include/SDL",
"/usr/include/GL",
}
libdirs {
......@@ -37,8 +38,19 @@ project "TEngine"
defines { [[TENGINE_HOME_PATH='".t-engine"']] }
configuration "macosx"
linkoptions { "mac/SDLmain.m", "-framework SDL", "-framework SDL_gfx", "-framework SDL_image", "-framework SDL_ttf", "-framework SDL_mixer", "-framework Cocoa" }
files { "mac/SDL*" }
linkoptions { "-framework SDL", "-framework SDL_gfx", "-framework SDL_image", "-framework SDL_ttf", "-framework SDL_mixer", "-framework Cocoa", "-framework OpenGL" }
files { "src/mac/SDL*" }
links { "IOKit" }
includedirs {
"/System/Library/Frameworks/OpenGL.framework/Headers",
"/Library/Frameworks/SDL.framework/Headers",
"/Library/Frameworks/SDL_net.framework/Headers",
"/Library/Frameworks/SDL_image.framework/Headers",
"/Library/Frameworks/SDL_ttf.framework/Headers",
"/Library/Frameworks/SDL_gfx.framework/Headers",
"/Library/Frameworks/SDL_mixer.framework/Headers"
}
defines { "USE_TENGINE_MAIN" }
targetdir "."
configuration "not macosx"
......@@ -68,6 +80,7 @@ project "physfs"
files { "src/physfs/platform/windows.c", }
configuration "macosx"
files { "src/physfs/platform/macosx.c", "src/physfs/platform/posix.c", }
includedirs { "/Library/Frameworks/SDL.framework/Headers" }
project "lua"
kind "StaticLib"
......
......@@ -410,6 +410,10 @@ static int sdl_new_surface(lua_State *L)
32,
rmask, gmask, bmask, amask
);
if (s == NULL)
printf("ERROR : SDL_CreateRGBSurface : %s\n",SDL_GetError());
return 1;
}
......@@ -503,6 +507,10 @@ static int sdl_surface_toscreen(lua_State *L)
// Jonction entre OpenGL et SDL.
glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, (*s)->w, (*s)->h, 0, texture_format, GL_UNSIGNED_BYTE, (*s)->pixels);
GLenum err = glGetError();
if (err != GL_NO_ERROR) {
printf("glTexImage2D : %s\n",gluErrorString(err));
}
glBegin( GL_QUADS ); /* Draw A Quad */
glTexCoord2f(0,0); glVertex2f(0 + x, 0 + y);
......
......@@ -37,5 +37,7 @@ inline void sdlDrawImage(SDL_Surface *dest, SDL_Surface *image, int x, int y)
r.h=image->h;
r.x=x;
r.y=y;
SDL_BlitSurface(image, NULL, dest, &r);
int errcode = SDL_BlitSurface(image, NULL, dest, &r);
if (errcode)
printf("ERROR! SDL_BlitSurface failed! (%d,%s)\n",errcode,SDL_GetError());
}
......@@ -36,8 +36,8 @@
#include <SDL.h>
#include <SDL_framerate.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <gl.h>
#include <glu.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -356,6 +356,12 @@ int resizeWindow(int width, int height)
/**
* Program entry point.
*/
// Let some platforms use a different entry point
#ifdef USE_TENGINE_MAIN
#define main tengine_main
#endif
int main(int argc, char *argv[])
{
// RNG init
......
#ifndef _MAP_H_
#define _MAP_H_
#include <GL/gl.h>
#include <gl.h>
typedef struct {
GLuint **grids_terrain;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment