Jump to content
Eternal Lands Official Forums
Beaverhunter

Current CVS errors

Recommended Posts

I get only these errors on march=k8, default compile features plus X86_64

framebuffer.c:29: error: 'GL_DEPTH24_STENCIL8_EXT' undeclared here (not in a function)
framebuffer.c: In function 'make_color_framebuffer':
framebuffer.c:303: warning: implicit declaration of function 'check_formats'

Share this post


Link to post
Share on other sites

I get only these errors on march=k8, default compile features plus X86_64

framebuffer.c:29: error: 'GL_DEPTH24_STENCIL8_EXT' undeclared here (not in a function)
framebuffer.c: In function 'make_color_framebuffer':
framebuffer.c:303: warning: implicit declaration of function 'check_formats'

 

Does also happen on march=pentium4, default cvs make.conf options enabled.

Share this post


Link to post
Share on other sites

Anyone working with CVS, please make sure that the client can swtill compile with the OLD compile options to reduce problems like this. But add the new compile options needed but commented out into make.defaults . Also it would be a good idea to have a single thread for your compile option where bugs specific to the new feature or major change can be tested and comments about new dependencies can be added as well..

 

Once the code becomes stable we can look at uncommenting the define in make.defaults

Absolutely. I'd prefer this were to happen. -DNEW_FILE_IO was the cause of many problems, and for some reason it was not commented in make.defaults, which meant I wasn't aware I was compiling the client with it. Serious PITA.

Share this post


Link to post
Share on other sites

A few errors in the last CVS under MSVC:

 

1. uint32_t, uint16_t and uint8_t are undefined in bbox_tree.h

 

2. In frustum.c float x, y and z are defined at an unappropriate place (not in the beginning of the function, or { )

 

3. Same for GLuint status int framebuffer.c

 

4. Same for GLhandleARB shader_object, vertex_shader_object, fragment_shader_object; in shader.c

 

5. .\framebuffer.c(30) : error C2065: 'GL_DEPTH24_STENCIL8_EXT' : undeclared identifier

 

6. int_fast32_t is undefined

 

7. And also shader.c, noise.c and reflection.c are in mac file format

 

PS: Really why are people using types like myveryownint32_t. Why create a type when you can use pure int, short, char, etc. :) I doubt someone would try to run EL on a platform with int 16 bits or something

Share this post


Link to post
Share on other sites
PS: Really why are people using types like myveryownint32_t. Why create a type when you can use pure int, short, char, etc. :) I doubt someone would try to run EL on a platform with int 16 bits or something

Often because of the libs that are linked. In the case of sound (which I'm working on atm), for alut they define everything ALuint, ALenum etc. In the case of SDL, some functions are important for portability to Mac and other little-endian systems.

 

It's all about portability in the library, whether we are using those platforms or not.

Share this post


Link to post
Share on other sites

Some of the errors below should have been fixed by other coders. Torg is going to look at the sound code. I'll do a mass-semi-fix for the rest. Semi fix? Well, it'll compile again, at least for me, but the original authors of the code will have to un-semi-break it in order to use those features.

Personally, if CVS doesn't compile, then new features can go jump in the lake (no matter how shiny the water gets. Nifty water is one of the things Xaphier has been doing. And the new FEATURES not getting commented out is also his doing. Just so Learner knows who to yell at :) )

 

My mass-semi-fix may make the code slightly slower or use more memory. It is not intended to be permenant, just enough so that people can use it and fix it.

 

I'll post again when I'm done.

 

 

I had to initially disable NEW_FILE_IO, USE_SHADER and USE_TR1 because they were just a serious pain in the arse - errors all over the place.
NEW_FILE_IO should be reasonably stable now, I've been doing work on it and have been trying to get people to test. But I know there were problems with it earlier. USE_SHADER is new as of a few hours ago. So's USE_TR1, which is even worse, since the TR1 is about experimental support for the next standard of C++... ie you can expect to not have it.
Anyone working with CVS, please make sure that the client can swtill compile with the OLD compile options to reduce problems like this. But add the new compile options needed but commented out into make.defaults . Also it would be a good idea to have a single thread for your compile option where bugs specific to the new feature or major change can be tested and comments about new dependencies can be added as well..
Testing with all option combinations is simply not possible. There are too many. However, yes, a compile and run with a toggle for the features that it touches on is good (or worse yet, when you see really obvious errors in someone's code that show they didn't even test with the FEATURE they added the check for).

Yes, new features should be commented. I can only think of one person who hasn't done that recently, most coders seem to be reasonably good at testing. Most of the larger changes also have the threads in forums... sometimes so do the smaller changes.

Can we get a list of what compile options client was last released with so we can at least test the "standard"?

 

I haven't looked to see if those errors are due to my code. :-S

Lets first get the list of FEATURES down. That was supposed to have happened already. Now is the time to do that, since it makes development and testing for the next version easier.

IIRC, Ent said we'd have a major cleanup in CVS after the last update... I'm still waiting to see this, as everyone seems to be in feature mode (including myself, to a degree, although what I'm doing is mostly like Torg, fixing up or finishing other work)

Share this post


Link to post
Share on other sites
IIRC, Ent said we'd have a major cleanup in CVS after the last update... I'm still waiting to see this, as everyone seems to be in feature mode (including myself, to a degree, although what I'm doing is mostly like Torg, fixing up or finishing other work)

Yeah, he also said that Xaphier was going to do it which is why I haven't even considered looking at it.

Share this post


Link to post
Share on other sites
Yeah, he also said that Xaphier was going to do it which is why I haven't even considered looking at it.
Yeah, I contributed to that thread, hoping it'd happen soon. But it hasn't, and we've gone into new-FEATURES mode, which I don't think we should be doing yet. Just a personal opinion, of course. But considering the trouble with the large list of FEATURES, I'm just about ready to start doing it myself. I think I'm the most active client-side dev, considering the longer term. According to berlios, the CVS commit ability belongs to:

drakos7 grum lachesis learner n0nane raduprv rei torg_el ttlanhil vegar xaphier

Grum and Vegar have done a bit lately, but haven't been (re)active for as long as they used to. Karenrei seems to be doing some map editor work, but isn't too active on the client (and is one of the newer people). You're a little bit newer as well, IIRC, though you've recently been active also. Learner mostly works on the server and his own projects (ie ants). Same for radu. 0ctane/n0nane is mostly busy trying to fix for OSX all the things the rest of us break. and Xaphier has been quiet for quite a while, and is now adding a heap of sometimes broken code to CVS.

If it's what it takes to clean up CVS, I'm willing to get yelled at and have to revert some changes. But hopefully the cleanup will actually happen soon as an organised group effort.

 

-----

 

As far as CVS, the default FEATURE set should now compile for anyone not using MSVC, I expect Torg will be finishing that soon.

Currently I'm going through the FEATURE list and testing (individually, the combinations of features would be too massive) those that I think actually should be on the list (NEW_FILE_IO should. Some of the old broken ones should not). That only goes for actual FEATURES ones, the platform and 32/64 bit ones I can't really test too well :)

Share this post


Link to post
Share on other sites

But considering the trouble with the large list of FEATURES, I'm just about ready to start doing it myself. I think I'm the most active client-side dev, considering the longer term.

By all means, go ahead.

 

And can we please make UPDATE_CONF=no the default?

Share this post


Link to post
Share on other sites

new error:

-DELC -DOSX -DUSE_SSE -DUSE_SSE2 -DUSE_SSE3 -D__SSE__ -DALUT_WAV -DX86_64 -DUNROLL4
-DMINIMAP -DGL_EXTENSION_CHECK -DNEW_WEATHER -DUSE_SHADER -DCLICKABLE_CONTINENT_MAP
-DAFK_FIX  -DALPHA_ACTORS  -DATI_9200_FIX  -DAUTO_UPDATE  -DCOUNTERS  -DCUSTOM_LOOK
-DCUSTOM_UPDATE  -DEYE_CANDY  -DFONTS_FIX  -DFUZZY_PATHS  -DIDLE_FIX  -DMASKING
-DNEW_ACTOR_ANIMATION  -DNEW_ALPHA  -DNEW_TEX  -DNOTEPAD  -DOPTIONS_I18N  -DSFX
-DSIMPLE_LOD  -DUSE_INLINE  -DZLIB

io/elfile.cpp: In static member function 'static std::string el_file::el_find_file(const std::string&)':
io/elfile.cpp:4: error: 'get_path_config' was not declared in this scope
io/elfile.cpp: In member function 'void el_file::open_gzip(const std::string&)':
io/elfile.cpp:36: error: 'get_path_config' was not declared in this scope
io/elfile.cpp: In member function 'void el_file::open(const std::string&)':
io/elfile.cpp:87: error: 'get_path_config' was not declared in this scope

Share this post


Link to post
Share on other sites
new error:
Oh, for the... The reason that happens is because get_path_config() is in a file that's properly #ifdef guarded, and the functions calling it are not. I'll go fix this in CVS next, thanks.

 

ed: Err. Ooh. the previous CVS commit took ages, so it ended up in the previous commit instead :)

Still, the big problem seems to be that you were attempting to compile files that shouldn't have been compiled, which I suspect is a problem with the OSX Makefile (sorry 0ctane!), adding the guards should have fixed it. Please let me know if there are any further problems :)

Edited by ttlanhil

Share this post


Link to post
Share on other sites

next one:

shader/shader.c: In function 'load_shader':
shader/shader.c:36: error: 'el_file_ptr' undeclared (first use in this function)
shader/shader.c:36: error: (Each undeclared identifier is reported only once
shader/shader.c:36: error: for each function it appears in.)
shader/shader.c:36: error: expected ';' before 'file'
shader/shader.c:39: error: 'file' undeclared (first use in this function)
shader/shader.c:53: warning: passing argument 4 of 'ELglShaderSourceARB' from incompatible pointer type
shader/shader.c: In function 'build_shader':
shader/shader.c:145: warning: passing argument 2 of 'ELglDeleteProgramsARB' from incompatible pointer type
shader/shader.c:161: warning: passing argument 2 of 'ELglDeleteProgramsARB' from incompatible pointer type
shader/shader.c: In function 'free_shaders':
shader/shader.c:186: warning: passing argument 2 of 'ELglDeleteProgramsARB' from incompatible pointer type

 

I created the OSX Makefile myself.

COBJS=2d_objects.o 3d_objects.o	\
actor_scripts.o actors.o alphamap.o asc.o \
books.o buddy.o bags.o bbox_tree.o \
cache.o cal.o chat.o colors.o console.o consolewin.o counters.o cursors.o	\
dialogues.o draw_scene.o	\
elconfig.o elmemory.o elwindows.o encyclopedia.o errors.o events.o	\
framebuffer.o filter.o font.o frustum.o	\
gamewin.o gl_init.o hud.o help.o highlight.o	\
ignore.o init.o interface.o items.o	\
keys.o knowledge.o lights.o list.o loginwin.o loading_win.o load_gl_extensions.o	\
main.o manufacture.o mapwin.o map.o	\
md5.o misc.o mines.o multiplayer.o minimap.o	\
new_actors.o new_character.o notepad.o	\
openingwin.o	\
particles.o paste.o pathfinder.o pm_log.o	\
questlog.o queue.o reflection.o	rules.o skills.o \
session.o serverpopup.o shadows.o sort.o sound.o spells.o stats.o storage.o symbol_table.o \
	special_effects.o \
text.o textures.o tile_map.o timers.o translate.o trade.o tabs.o	\
update.o weather.o widgets.o \
books/fontdef.o books/parser.o books/symbols.o books/typesetter.o \
	io/e3d_io.o io/elc_io.o io/map_io.o io/elpathwrapper.o \
	shader/noise.o shader/shader.o
CXXOBJS=cal3d_wrapper.o eye_candy_wrapper.o \
eye_candy/eye_candy.o eye_candy/math_cache.o eye_candy/effect_lamp.o \
eye_candy/effect_candle.o \
eye_candy/effect_campfire.o eye_candy/effect_fountain.o \
eye_candy/effect_teleporter.o eye_candy/effect_firefly.o \
eye_candy/effect_sword.o eye_candy/effect_summon.o \
eye_candy/effect_selfmagic.o eye_candy/effect_targetmagic.o \
eye_candy/effect_ongoing.o eye_candy/effect_impact.o \
eye_candy/effect_smoke.o eye_candy/effect_bag.o eye_candy/effect_cloud.o \
eye_candy/effect_harvesting.o eye_candy/effect_wind.o \
eye_candy/effect_breath.o eye_candy/effect_mines.o \
io/elfilewrapper.o io/elfile.o io/zipfilesystem.o exceptions/extendedexception.o

 

/EDIT

el_file_ptr is defined in io/elfilewrapper.h but #ifdef'ed by NEW_FILE_IO ...

Edited by Florian

Share this post


Link to post
Share on other sites
I created the OSX Makefile myself.
Ahh, well, that's the problem then. Same as before, actually.

Don't include things like shader.o if you don't have USE_SHADER set, or io/elfile.cpp without NEW_FILE_IO set, etc.

That's why, in the windows/linux makefiles, these are set dependant on use defines used. I understand this may be hard or not possible on other platforms, such as OSX, but if you're rolling your own Makefile you really should read Makefile.linux to see which files should be included.

 

Please try removing the files withe the offending functions, and it should work (Yes, ideally they'd all have the #ifdef guards to prevent any of the file being used if the feature isn't set, but that's not something we can rely upon :) )

Share this post


Link to post
Share on other sites

That's why, in the windows/linux makefiles, these are set dependant on use defines used. I understand this may be hard or not possible on other platforms, such as OSX, but if you're rolling your own Makefile you really should read Makefile.linux to see which files should be included.

 

Please try removing the files withe the offending functions, and it should work (Yes, ideally they'd all have the #ifdef guards to prevent any of the file being used if the feature isn't set, but that's not something we can rely upon :) )

 

make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.

So the problem is not OSX but my limited understanding of the Makefile syntax and make features. I'll try to make the Makefile.linux work on OSX this evening (European evening).

Share this post


Link to post
Share on other sites
So the problem is not OSX but my limited understanding of the Makefile syntax and make features. I'll try to make the Makefile.linux work on OSX this evening (European evening).
Sorry, I should have explained better, but I was somewhat rushed for time, as well as kinda frustrated at having to fix CVS.

Here's a slightly longer version.

 

Most of the files in ELC are used no matter which FEATURES are enabled, it's just that how some parts work may change. However a few files are only used when a certain FEATURE is enabled. the files in shader/ for example, are only going to be useful if USE_SHADER is defined. And many files in io/ require NEW_FILE_IO.

 

The way Makefile.linux is written means that these files are only added to the list of files to compile if the feature is set. Some pseudocode:

foreach FEATURE append {FEATURE}_COBJS to COBJS and {FEATURE}_CXXOBJS to CXXOBJS

 

Some files are written so that being included when they aren't wanted is safe. This is, of course, needed for when there isn't a Makefile set up for the platform; or if the user has some other reason why they can't or won't use the Makefile we supply. AFAIK, MSVC has the same problem that you do, because you have to add files to the project; not include files based on some check.

 

So check Makefile.linux, the COBJs you should use; and the FEATURE_COBJs should be appended if you use FEATURE. That applies for anyone not using Makefile.linux or Makefile.win

 

Hopefully that's clearer now :devlish:

 

 

ed: For those who have noticed that perspective was messed up (cranked way too high to look decent), I've reverted some of the code to fix that.

Edited by ttlanhil

Share this post


Link to post
Share on other sites

Sorry all. I do not maintain the Makefile.osx since I use Xcode. Florian has been brave enough to get command line compilation going. The glext.h issue is a whole other can of worms (that Florian and I have previously discussed).

Share this post


Link to post
Share on other sites

Well, since I don't want to touch my System's glext.h I patched load_gl_extensions.h:

Index: load_gl_extensions.h
===================================================================
RCS file: /cvsroot/elc/elc/load_gl_extensions.h,v
retrieving revision 1.13
diff -u -d -p -r1.13 load_gl_extensions.h
--- load_gl_extensions.h		24 Jun 2007 13:52:57 -0000	  1.13
+++ load_gl_extensions.h		25 Jun 2007 15:09:59 -0000
@@ -10,6 +10,9 @@ typedef unsigned int uint_fast32_t;
#ifdef OSX
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
+#if GL_GLEXT_VERSION == 7 // original OSX 10.4.9 glext.h missing all we need
+#include "osxglext.h"
+#endif
#else
#include <GL/gl.h>
#include <GL/glext.h>

osxglext.h looks like this:

#ifndef APIENTRY
#define APIENTRY
#endif

#ifndef APIENTRYP
#define APIENTRYP *
#endif

typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);

(basically copy&paste from ubuntu 6.06.1 and a recent SDL glext.h)

 

/System/Library/Frameworks contains some incompatible version of OpenAL, so I had to move that away. The version which works with EL is in /Library/Frameworks.

 

/Edit:

ah, and another "small" thing: you need a SDLmain.m (objective-c) file ...

/*   SDLMain.m - main entry point for our Cocoa-ized SDL app
   Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
   Non-NIB-Code & other changes: Max Horn <max@quendi.de>

Feel free to customize this file to suit your needs
*/

#import "SDL.h"
#import "SDLMain.h"
#import <sys/param.h> /* for MAXPATHLEN */
#import <unistd.h>

/* Use this flag to determine whether we use SDLMain.nib or not */
#define		 SDL_USE_NIB_FILE		0


static int	gArgc;
static char  **gArgv;
static BOOL   gFinderLaunch;
char parentdir[MAXPATHLEN];

#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#else
/* An internal Apple class used to setup Apple menus */
@interface NSAppleMenuController:NSObject {}
- (void)controlMenu:(NSMenu *)aMenu;
@end
#endif

@interface SDLApplication : NSApplication
@end

@implementation SDLApplication
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end


/* The main class of the application, the application's delegate */
@implementation SDLMain

/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
//	char parentdir[MAXPATHLEN];
char *c;

strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
c = (char*) parentdir;

while (*c != '\0')	 /* go to end */
	c++;

while (*c != '/')	  /* back up to parent */
	c--;

*c++ = '\0';			 /* cut off last part (binary name) */

if (shouldChdir)
{
  assert ( chdir (parentdir) == 0 );   /* chdir to the binary app's parent */
  assert ( chdir ("../Resources/data") == 0 ); /* chdir to the .app's resources/data */
}
}

#if SDL_USE_NIB_FILE

/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;

aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
	[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];

enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
	aRange = [[menuItem title] rangeOfString:@"SDL App"];
	if (aRange.length != 0)
		[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
	if ([menuItem hasSubmenu])
		[self fixMenu:[menuItem submenu] withAppName:appName];
}
[ aMenu sizeToFit ];
}

#else

void setupAppleMenu(void)
{
/* warning: this code is very odd */
NSAppleMenuController *appleMenuController;
NSMenu *appleMenu;
NSMenuItem *appleMenuItem;

appleMenuController = [[NSAppleMenuController alloc] init];
appleMenu = [[NSMenu alloc] initWithTitle:@""];
appleMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];

[appleMenuItem setSubmenu:appleMenu];

/* yes, we do need to add it and then remove it --
   if you don't add it, it doesn't get displayed
   if you don't remove it, you have an extra, titleless item in the menubar
   when you remove it, it appears to stick around
   very, very odd */
[[NSApp mainMenu] addItem:appleMenuItem];
[appleMenuController controlMenu:appleMenu];
[[NSApp mainMenu] removeItem:appleMenuItem];
[appleMenu release];
[appleMenuItem release];
}

/* Create a window menu */
void setupWindowMenu(void)
{
NSMenu			  *windowMenu;
NSMenuItem  *windowMenuItem;
NSMenuItem  *menuItem;


windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];

/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];

/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];

/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];

/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}

/* Replacement for NSApplicationMain */
void CustomApplicationMain (argc, argv)
{
NSAutoreleasePool   *pool = [[NSAutoreleasePool alloc] init];
SDLMain							 *sdlMain;

/* Ensure the application object is initialised */
[SDLApplication sharedApplication];

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setupAppleMenu();
setupWindowMenu();

/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];

/* Start the main event loop */
[NSApp run];

[sdlMain release];
[pool release];
}

#endif

/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;

/* Set the working directory to the .app's resources directory */
[self setupWorkingDirectory:1];

#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]];
#endif

/* Hand off to main application code */
status = SDL_main (gArgc, gArgv);

/* We're done, thank you for playing */
exit(status);
}
@end


@implementation NSString (ReplaceSubString)

- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;

bufferSize = selfLen + aStringLen - aRange.length;
buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));

/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];

/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];

/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];

/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];

NSDeallocateMemoryPages(buffer, bufferSize);

return result;
}

@end



#ifdef main
#  undef main
#endif


/* Main entry point to executable - should *not* be SDL_main! */
int main (int argc, char **argv)
{

/* Copy the arguments into a global variable */
int i;

/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
	gArgc = 1;
	gFinderLaunch = YES;
} else {
	gArgc = argc;
	gFinderLaunch = NO;
}
gArgv = (char**) malloc (sizeof(*gArgv) * (gArgc+1));
assert (gArgv != NULL);
for (i = 0; i < gArgc; i++)
	gArgv[i] = argv[i];
gArgv[i] = NULL;

#if SDL_USE_NIB_FILE
[SDLApplication poseAsClass:[NSApplication class]];
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}

... and SDLmain.h

/*   SDLMain.m - main entry point for our Cocoa-ized SDL app
   Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
   Non-NIB-Code & other changes: Max Horn <max@quendi.de>

Feel free to customize this file to suit your needs
*/

#import <Cocoa/Cocoa.h>

@interface SDLMain : NSObject
@end

Edited by Florian

Share this post


Link to post
Share on other sites

Oki, good job guys. I just updated the CVS and now I only get errors from map.c and elpathwrapper.c:

 

1>map.c
1>.\map.c(323) : error C2065: 'int_fast32_t' : undeclared identifier
1>.\map.c(323) : error C2146: syntax error : missing ';' before identifier 'terrain_buffer_size'
1>.\map.c(323) : error C2065: 'terrain_buffer_size' : undeclared identifier
1>.\map.c(324) : error C2146: syntax error : missing ';' before identifier 'water_buffer_size'
1>.\map.c(324) : error C2065: 'water_buffer_size' : undeclared identifier
1>.\map.c(325) : error C2146: syntax error : missing ';' before identifier 'i'
1>.\map.c(325) : error C2065: 'i' : undeclared identifier
1>.\map.c(325) : error C2065: 'j' : undeclared identifier
1>.\map.c(325) : error C2065: 'cur_tile' : undeclared identifier
1>elpathwrapper.c
1>.\io\elpathwrapper.c(16) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

 

To fix this, add:

#ifdef _MSC_VER
typedef signed int int_fast32_t;
#endif //MSVC

To map.c somewhere in the beginning.

 

In the elpathwrapper.c there is a #ifdef WINDOWS, but for some reason at this stage it doesn't have WINDOWS flagged so it jumps to the #else.

 

However, getting rid of these problems in "my own way", I get these link errors:

1>noise.obj : error LNK2001: unresolved external symbol _glTexImage3D
1>elpathwrapper.obj : error LNK2001: unresolved external symbol _snprintf
1>elpathwrapper.obj : error LNK2001: unresolved external symbol _S_ISDIR

 

=/ I have tried to clean/rebuild CVS and so on, but nothing.

 

I'm using:

NDEBUG

ELC

EYE_CANDY

WINDOW_CHAT

NEW_FRUSTUM

NEW_TEX

OPTIONS_I18N

AUTO_UPDATE

COUNTERS

SFX

FONTS_FIX

AFK_FIX

CUSTOM_LOOK

CUSTOM_UPDATE

SIMPLE_LOD

USE_ACTOR_DEFAULTS

NOTEPAD

USE_INLINE

ZLIB

FUZZY_PATHS

MASKING

ACTOR_ALPHA

NEW_ALPHA

__SSE__

IDLE_FIX

NEW_E3D_FORMAT

MINIMAP

NEW_LIGHTING

ANTI_ALIAS

NEW_ACTOR_ANIMATION

NEW_FILE_IO

 

Anything I should add or remove? (I know there is the make.default but well there are obviously many other flags that can be used)

Edited by Beaverhunter

Share this post


Link to post
Share on other sites

However, getting rid of these problems in "my own way", I get these link errors:

Maybe we could just distribute http://msinttypes.googlecode.com/svn/trunk/stdint.h and http://msinttypes.googlecode.com/svn/trunk/inttypes.h with the client, and include them in global.h if _MSC_VER is defined? That way, we can stop worrying about MSVC++ C99 noncompliance.

 

Regarding snprintf on MSVC: http://www.di-mgt.com.au/cprog.html#snprintf

 

For the last error, regarding S_ISDIR:

#ifndef S_ISDIR
#define S_ISDIR(m) (m & S_IFDIR == S_IFDIR)
#endif

Edited by crusadingknight

Share this post


Link to post
Share on other sites

CVS as of 2 minutes ago, options as above, segfaulted after typing in channel:

[Switching to Thread 46988055898992 (LWP 6528)]
0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=19, offset_start=0,
cursor=-1, width=556, height=377, text_zoom=1, select=0x45c9ec8)
at font.c:372
372					 if ((select != NULL) && (select->lines[cur_line].msg == -1))
(gdb) backtrace
#0  0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=19, offset_start=0,
cursor=-1, width=556, height=377, text_zoom=1, select=0x45c9ec8)
at font.c:372
#1  0x00000000004b86f7 in text_field_draw (w=0x45c9ef0) at widgets.c:2686
#2  0x0000000000443f34 in draw_window (win=0x45e31e0) at elwindows.c:1082
#3  0x00000000004444f6 in display_window (win_id=1) at elwindows.c:1222
#4  0x0000000000441842 in display_windows (level=1) at elwindows.c:57
#5  0x000000000043ac1f in draw_scene () at draw_scene.c:92
#6  0x0000000000471240 in start_rendering () at main.c:128
#7  0x00000000004715f7 in main (argc=1, argv=0x7fff6a9ac7f8) at main.c:247

Share this post


Link to post
Share on other sites

CVS as of 2 minutes ago, options as above, segfaulted after typing in channel:

[Switching to Thread 46988055898992 (LWP 6528)]
0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=19, offset_start=0,
cursor=-1, width=556, height=377, text_zoom=1, select=0x45c9ec8)
at font.c:372
372					 if ((select != NULL) && (select->lines[cur_line].msg == -1))
(gdb) backtrace
#0  0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=19, offset_start=0,
cursor=-1, width=556, height=377, text_zoom=1, select=0x45c9ec8)
at font.c:372
#1  0x00000000004b86f7 in text_field_draw (w=0x45c9ef0) at widgets.c:2686
#2  0x0000000000443f34 in draw_window (win=0x45e31e0) at elwindows.c:1082
#3  0x00000000004444f6 in display_window (win_id=1) at elwindows.c:1222
#4  0x0000000000441842 in display_windows (level=1) at elwindows.c:57
#5  0x000000000043ac1f in draw_scene () at draw_scene.c:92
#6  0x0000000000471240 in start_rendering () at main.c:128
#7  0x00000000004715f7 in main (argc=1, argv=0x7fff6a9ac7f8) at main.c:247

Hmmm, interesting, looks like select->lines[cur_line] is crashing it. Unfortunately I don't have much time to test it tonight. Can you see if you can reproduce it, and if it crashes at the same point, do a

print cur_line
print select->lines

?

 

Thanks.

Share this post


Link to post
Share on other sites

I can reproduce it but it might be related to me

* changing resolution, toggling isometric view off and setting shadows, cloud shadows, shadow mapping, reflections and then

* talking in channel

 

also, just a quick question from a non-programmer: insert that stuff where?? you mean after/before line 372 in fonts.c? :)

Share this post


Link to post
Share on other sites

I can reproduce it but it might be related to me

* changing resolution, toggling isometric view off and setting shadows, cloud shadows, shadow mapping, reflections and then

* talking in channel

 

also, just a quick question from a non-programmer: insert that stuff where?? you mean after/before line 372 in fonts.c? :)

Type each of them at the (gdb) prompt where you typed 'backtrace'.

Share this post


Link to post
Share on other sites

also, just a quick question from a non-programmer: insert that stuff where?? you mean after/before line 372 in fonts.c? :)

Type each of them at the (gdb) prompt where you typed 'backtrace'.

Thanks :)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47517393423216 (LWP 7037)]
0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=3, offset_start=0,
cursor=-1, width=906, height=617, text_zoom=1, select=0x45a8d08)
at font.c:372
372					 if ((select != NULL) && (select->lines[cur_line].msg == -1))
(gdb) print cur_line
$1 = 0
(gdb) backtrace
#0  0x000000000044ad2a in draw_messages (x=10, y=25, msgs=0x3e8c0c0,
msgs_size=5000, filter=255 'ÿ', msg_start=3, offset_start=0,
cursor=-1, width=906, height=617, text_zoom=1, select=0x45a8d08)
at font.c:372
#1  0x00000000004b86f7 in text_field_draw (w=0x45cdd90) at widgets.c:2686
#2  0x0000000000443f34 in draw_window (win=0x45e3220) at elwindows.c:1082
#3  0x00000000004444f6 in display_window (win_id=1) at elwindows.c:1222
#4  0x0000000000441842 in display_windows (level=1) at elwindows.c:57
#5  0x000000000043ac1f in draw_scene () at draw_scene.c:92
#6  0x0000000000471240 in start_rendering () at main.c:128
#7  0x00000000004715f7 in main (argc=1, argv=0x7fff2ba14868) at main.c:247
(gdb) print cur_line
$2 = 0
(gdb) print select->lines
$3 = (text_field_line *) 0x0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×