Hi all,
Did some possibly useless patches for SG and FG plib branch:
simgear.plib-distclean.patch:
The directory compatibility/ and threads/ are repeated in
DIST_SUBDIRS as they already present in $(SUBDIRS), causing 'make
distclean' in SG broken.
simgear.plib-dependencies.patch:
Dependencies fixes in SG, mostly when building those test apps. This
fixes make -j which wasn't working properly before.
flightgear.plib-dependencies.patch:
Same thing again, make -j wasn't working properly.
flightgear.plib-glut-SDL.patch:
Currently when you configure FG with --enable-sdl, fgfs is still
linked against glut for no reasons. Along with this fix, I've also
updated gl-info, test-env-map and 3dconvert to use SDL with
--enable-sdl. The only difference is I don't see a way to create a GL
context with SDL without having the SDL window mapped/displayed. As a
result for gl-info and 3dconvert you might see the window appearing for
half a second or so. Hopefully this isn't a big deal.
Patches tested with both building in the tree and out of tree.
Some of these can be easily ported to the OSG branch but I haven't
got to it yet.
P.S. apply patches with -p1 in the root of the source dir.
Pigeon.
commit f2949dca7ae2b6264184ad256ff33b67e5c087c8
Author: Pigeon <[EMAIL PROTECTED]>
Date: Tue May 15 22:24:25 2007 +1000
src/Main/Makefile.am dependencies fix
diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am
index 5ac0cf0..fdc5809 100644
--- a/src/Main/Makefile.am
+++ b/src/Main/Makefile.am
@@ -60,7 +60,7 @@ libMain_a_SOURCES = \
fgfs_SOURCES = bootstrap.cxx
fgfs_LDADD = \
- $(top_builddir)/src/Main/libMain.a \
+ libMain.a \
$(top_builddir)/src/Aircraft/libAircraft.a \
$(top_builddir)/src/ATC/libATC.a \
$(top_builddir)/src/Cockpit/libCockpit.a \
commit 43eb8463a884e68c19aa3ac1c71adc6dd7a16ea7
Author: Pigeon <[EMAIL PROTECTED]>
Date: Fri May 18 21:23:40 2007 +1000
Not linking against glut when using SDL.
diff --git a/configure.ac b/configure.ac
index 0548591..1fe08f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,9 +265,10 @@ case "${host}" in
fi
AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
- AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
if test "x$enable_sdl" = "xyes"; then
AC_SEARCH_LIBS(SDL_Init, SDL)
+ else
+ AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
fi
;;
diff --git a/tests/gl-info.c b/tests/gl-info.c
index 4aff41d..1410b7b 100644
--- a/tests/gl-info.c
+++ b/tests/gl-info.c
@@ -20,7 +20,14 @@ Date: Fri, 24 Apr 1998 07:33:51 -0800
#include <simgear/compiler.h>
+#if defined(PU_USE_GLUT)
#include SG_GLUT_H
+#elif defined(PU_USE_SDL)
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#else
+#error FlightGear is not configured to use either GLUT or SDL
+#endif
void getPrints ( GLenum token, char *string )
@@ -58,9 +65,16 @@ void getPrinti ( GLenum token, char *string )
int main ( int argc, char **argv )
{
+#if defined(PU_USE_GLUT)
glutInit ( &argc, argv ) ;
glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
glutCreateWindow ( "You should never see this window!" ) ;
+#elif defined(PU_USE_SDL)
+ SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
+ atexit(SDL_Quit);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_SetVideoMode(320, 240, 0, SDL_OPENGL);
+#endif
getPrints ( GL_VENDOR , "GL_VENDOR" ) ;
getPrints ( GL_RENDERER , "GL_RENDERER" ) ;
diff --git a/tests/test-env-map.cxx b/tests/test-env-map.cxx
index 6d369ef..3c9ed0c 100644
--- a/tests/test-env-map.cxx
+++ b/tests/test-env-map.cxx
@@ -12,7 +12,15 @@
#include <simgear/compiler.h>
+#if defined(PU_USE_GLUT)
#include SG_GLUT_H
+#elif defined(PU_USE_SDL)
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#else
+#error FlightGear is not configured to use either GLUT or SDL
+#endif
#define TEXRES_X 256
#define TEXRES_Y 256
@@ -23,6 +31,10 @@ GLuint texName;
int window_x = 640, window_y = 480;
float alpha = 0.0, beta = 0.0;
+#if defined(PU_USE_SDL)
+static bool NeedRedraw = false;
+#endif
+
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
@@ -207,8 +219,12 @@ void display()
glFlush();
glDisable(GL_TEXTURE_2D);
+#if defined(PU_USE_GLUT)
glutPostRedisplay () ;
glutSwapBuffers () ;
+#elif defined(PU_USE_SDL)
+ NeedRedraw = true;
+#endif
}
void keyboard (unsigned char key, int x, int y)
@@ -244,18 +260,63 @@ void keyboard (unsigned char key, int x, int y)
}
}
+#if defined(PU_USE_SDL)
+void sdlMainLoop()
+{
+ display();
+ while(1) {
+ SDL_Event e;
+ int key;
+ while(SDL_PollEvent(&e)) {
+ switch(e.type) {
+ case SDL_QUIT:
+ break;
+ case SDL_KEYDOWN:
+ key = e.key.keysym.sym;
+ keyboard(key, 0, 0);
+ display ();
+ break;
+ case SDL_VIDEORESIZE:
+ SDL_SetVideoMode(e.resize.w, e.resize.h, 0, SDL_OPENGL|SDL_RESIZABLE);
+ reshape(e.resize.w, e.resize.h);
+ break;
+ case SDL_VIDEOEXPOSE:
+ display ();
+ break;
+ }
+ }
+ if(NeedRedraw) {
+ SDL_GL_SwapBuffers ();
+ }
+ }
+}
+#endif
+
int main(int argc, char** argv)
{
+#if defined(PU_USE_GLUT)
glutInitWindowSize(window_x, window_y);
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+#elif defined(PU_USE_SDL)
+ SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_SetVideoMode(window_x, window_y, 0, SDL_OPENGL|SDL_RESIZABLE);
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+#endif
+
init();
+
+#if defined(PU_USE_GLUT)
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
-
glutMainLoop();
+#elif defined(PU_USE_SDL)
+ sdlMainLoop();
+#endif
+
return 0;
}
diff --git a/utils/Modeller/3dconvert.cxx b/utils/Modeller/3dconvert.cxx
index db9859e..eacf69c 100644
--- a/utils/Modeller/3dconvert.cxx
+++ b/utils/Modeller/3dconvert.cxx
@@ -6,7 +6,14 @@
#include <iostream>
+#if defined(PU_USE_GLUT)
#include SG_GLUT_H
+#elif defined(PU_USE_SDL)
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#else
+#error FlightGear is not configured to use either GLUT or SDL
+#endif
#include <plib/ssg.h>
@@ -22,12 +29,19 @@ main (int ac, char ** av)
return 1;
}
+#if defined(PU_USE_GLUT)
int fakeac = 1;
char * fakeav[] = { "3dconvert",
"Convert a 3D Model",
0 };
glutInit(&fakeac, fakeav);
glutCreateWindow(fakeav[1]);
+#elif defined(PU_USE_SDL)
+ SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
+ atexit(SDL_Quit);
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ SDL_SetVideoMode(320, 240, 0, SDL_OPENGL);
+#endif
ssgInit();
ssgEntity * object = ssgLoad(av[1]);
commit d0ea4d5f32f55c15d55e9e60c7b22a3945035cca
Author: Pigeon <[EMAIL PROTECTED]>
Date: Tue May 15 21:56:17 2007 +1000
Some dependencies fix with Makefile.am, so that make -j works
diff --git a/simgear/io/Makefile.am b/simgear/io/Makefile.am
index d7149cf..f597465 100644
--- a/simgear/io/Makefile.am
+++ b/simgear/io/Makefile.am
@@ -27,7 +27,7 @@ noinst_PROGRAMS = decode_binobj socktest lowtest tcp_server tcp_client
tcp_server_SOURCES = tcp_server.cxx
tcp_server_LDADD = \
- $(top_builddir)/simgear/io/libsgio.a \
+ libsgio.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
@@ -38,7 +38,7 @@ tcp_server_LDADD = \
tcp_client_SOURCES = tcp_client.cxx
tcp_client_LDADD = \
- $(top_builddir)/simgear/io/libsgio.a \
+ libsgio.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
@@ -49,7 +49,7 @@ tcp_client_LDADD = \
socktest_SOURCES = socktest.cxx
socktest_LDADD = \
- $(top_builddir)/simgear/io/libsgio.a \
+ libsgio.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
@@ -60,7 +60,7 @@ socktest_LDADD = \
lowtest_SOURCES = lowtest.cxx
lowtest_LDADD = \
- $(top_builddir)/simgear/io/libsgio.a \
+ libsgio.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
@@ -69,7 +69,7 @@ lowtest_LDADD = \
decode_binobj_SOURCES = decode_binobj.cxx
decode_binobj_LDADD = \
- $(top_builddir)/simgear/io/libsgio.a \
+ libsgio.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
diff --git a/simgear/magvar/Makefile.am b/simgear/magvar/Makefile.am
index 619e283..03aa978 100644
--- a/simgear/magvar/Makefile.am
+++ b/simgear/magvar/Makefile.am
@@ -13,7 +13,7 @@ noinst_PROGRAMS = testmagvar
testmagvar_SOURCES = testmagvar.cxx
testmagvar_LDADD = \
- $(top_builddir)/simgear/magvar/libsgmagvar.a \
+ libsgmagvar.a \
$(base_LIBS)
INCLUDES = -I$(top_srcdir)
diff --git a/simgear/misc/Makefile.am b/simgear/misc/Makefile.am
index 4e9b64e..44221dd 100644
--- a/simgear/misc/Makefile.am
+++ b/simgear/misc/Makefile.am
@@ -26,7 +26,7 @@ noinst_PROGRAMS = tabbed_value_test swap_test
tabbed_value_test_SOURCES = tabbed_values_test.cxx
tabbed_value_test_LDADD = \
- $(top_builddir)/simgear/misc/libsgmisc.a \
+ libsgmisc.a \
$(top_builddir)/simgear/xml/libsgxml.a \
$(top_builddir)/simgear/debug/libsgdebug.a
diff --git a/simgear/props/Makefile.am b/simgear/props/Makefile.am
index 30265b6..f1cf6f9 100644
--- a/simgear/props/Makefile.am
+++ b/simgear/props/Makefile.am
@@ -16,7 +16,7 @@ noinst_PROGRAMS = props_test
props_test_SOURCES = props_test.cxx
props_test_LDADD = \
- $(top_builddir)/simgear/props/libsgprops.a \
+ libsgprops.a \
$(top_builddir)/simgear/xml/libsgxml.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
diff --git a/simgear/route/Makefile.am b/simgear/route/Makefile.am
index ead62da..d112265 100644
--- a/simgear/route/Makefile.am
+++ b/simgear/route/Makefile.am
@@ -15,7 +15,7 @@ noinst_PROGRAMS = waytest routetest
waytest_SOURCES = waytest.cxx
waytest_LDADD = \
- $(top_builddir)/simgear/route/libsgroute.a \
+ libsgroute.a \
$(top_builddir)/simgear/math/libsgmath.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
@@ -25,7 +25,7 @@ waytest_LDADD = \
routetest_SOURCES = routetest.cxx
routetest_LDADD = \
- $(top_builddir)/simgear/route/libsgroute.a \
+ libsgroute.a \
$(top_builddir)/simgear/math/libsgmath.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(base_LIBS)
diff --git a/simgear/screen/Makefile.am b/simgear/screen/Makefile.am
index 482bba6..11e5a1d 100644
--- a/simgear/screen/Makefile.am
+++ b/simgear/screen/Makefile.am
@@ -41,7 +41,7 @@ noinst_PROGRAMS = TestRenderTexture
TestRenderTexture_SOURCES = TestRenderTexture.cpp
TestRenderTexture_LDADD = \
- $(top_builddir)/simgear/screen/libsgscreen.a \
+ libsgscreen.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(opengl_LIBS)
endif
diff --git a/simgear/serial/Makefile.am b/simgear/serial/Makefile.am
index 17af84e..0cace19 100644
--- a/simgear/serial/Makefile.am
+++ b/simgear/serial/Makefile.am
@@ -11,7 +11,7 @@ noinst_PROGRAMS = testserial
testserial_SOURCES = testserial.cxx
testserial_LDADD = \
- $(top_builddir)/simgear/serial/libsgserial.a \
+ libsgserial.a \
$(top_builddir)/simgear/debug/libsgdebug.a
INCLUDES = -I$(top_srcdir)
diff --git a/simgear/sound/Makefile.am b/simgear/sound/Makefile.am
index 86aeebe..fc7e41f 100644
--- a/simgear/sound/Makefile.am
+++ b/simgear/sound/Makefile.am
@@ -26,7 +26,7 @@ openal_test1_LDADD = \
$(openal_LIBS)
openal_test2_LDADD = \
- $(top_builddir)/simgear/sound/libsgsound.a \
+ libsgsound.a \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
$(top_builddir)/simgear/structure/libsgstructure.a \
commit 39e75c73bff5712eb1e2e17dd0e55555a709a44e
Author: Pigeon <[EMAIL PROTECTED]>
Date: Tue May 15 18:35:27 2007 +1000
simgear/Makefile.am fix
diff --git a/simgear/Makefile.am b/simgear/Makefile.am
index 97b15b0..61d53f4 100644
--- a/simgear/Makefile.am
+++ b/simgear/Makefile.am
@@ -34,4 +34,4 @@ SUBDIRS = \
$(SGTHREAD_DIR) \
timing
-DIST_SUBDIRS = $(SUBDIRS) compatibility threads
+DIST_SUBDIRS = $(SUBDIRS)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel