Changeset 2977 in orxonox.OLD for orxonox/branches/osX
- Timestamp:
- Nov 24, 2004, 12:50:55 PM (20 years ago)
- Location:
- orxonox/branches/osX
- Files:
-
- 12 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/osX/configure
r2879 r2977 3741 3741 fi 3742 3742 3743 # On IRIX 5.3, sys/types and inttypes.h are conflicting. 3743 3744 ### CHECKING FOR SYSTEM ### 3745 3746 echo "$as_me:$LINENO: checking for System" >&5 3747 echo $ECHO_N "checking for System... $ECHO_C" >&6 3748 case `uname` in 3749 ### WINDOWS ### 3750 *MINGW*) 3751 echo "mingw-WINDOWS detected" 3752 3753 mingw="yes" 3754 MSBITFIELDS="-mms-bitfields" 3755 MWINDOWS="-mwindows" 3756 3757 # checking gl header 3758 #done before loop 3759 3760 # checking gl header 3761 # On IRIX 5.3, sys/types and inttypes.h are conflicting. 3744 3762 3745 3763 … … 3813 3831 3814 3832 3815 for ac_header in 3833 3834 for ac_header in GL/gl.h 3816 3835 do 3817 3836 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 3958 3977 _ACEOF 3959 3978 3979 else 3980 { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5 3981 echo "$as_me: error: cannot find opengl headers" >&2;} 3982 { (exit 1); exit 1; }; } 3960 3983 fi 3961 3984 3962 3985 done 3963 3986 3964 3965 3966 3967 ### CHECKING FOR SYSTEM ### 3968 3969 echo "$as_me:$LINENO: checking for System" >&5 3970 echo $ECHO_N "checking for System... $ECHO_C" >&6 3971 case `uname` in 3972 ### WINDOWS ### 3973 *MINGW*) 3974 echo "mingw-WINDOWS detected" 3975 3976 mingw="yes" 3977 MSBITFIELDS="-mms-bitfields" 3978 MWINDOWS="-mwindows" 3979 3980 # checking gl header 3981 #done before loop 3982 3983 # checking gl header (has to be here because of a Linux error) 3984 3985 for ac_header in GL/gl.h 3987 # checking for Windows openGl library 3988 echo "$as_me:$LINENO: checking for main in -lopengl32" >&5 3989 echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6 3990 if test "${ac_cv_lib_opengl32_main+set}" = set; then 3991 echo $ECHO_N "(cached) $ECHO_C" >&6 3992 else 3993 ac_check_lib_save_LIBS=$LIBS 3994 LIBS="-lopengl32 $LIBS" 3995 cat >conftest.$ac_ext <<_ACEOF 3996 /* confdefs.h. */ 3997 _ACEOF 3998 cat confdefs.h >>conftest.$ac_ext 3999 cat >>conftest.$ac_ext <<_ACEOF 4000 /* end confdefs.h. */ 4001 4002 4003 int 4004 main () 4005 { 4006 main (); 4007 ; 4008 return 0; 4009 } 4010 _ACEOF 4011 rm -f conftest.$ac_objext conftest$ac_exeext 4012 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4013 (eval $ac_link) 2>conftest.er1 4014 ac_status=$? 4015 grep -v '^ *+' conftest.er1 >conftest.err 4016 rm -f conftest.er1 4017 cat conftest.err >&5 4018 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4019 (exit $ac_status); } && 4020 { ac_try='test -z "$ac_c_werror_flag" 4021 || test ! -s conftest.err' 4022 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4023 (eval $ac_try) 2>&5 4024 ac_status=$? 4025 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4026 (exit $ac_status); }; } && 4027 { ac_try='test -s conftest$ac_exeext' 4028 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4029 (eval $ac_try) 2>&5 4030 ac_status=$? 4031 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4032 (exit $ac_status); }; }; then 4033 ac_cv_lib_opengl32_main=yes 4034 else 4035 echo "$as_me: failed program was:" >&5 4036 sed 's/^/| /' conftest.$ac_ext >&5 4037 4038 ac_cv_lib_opengl32_main=no 4039 fi 4040 rm -f conftest.err conftest.$ac_objext \ 4041 conftest$ac_exeext conftest.$ac_ext 4042 LIBS=$ac_check_lib_save_LIBS 4043 fi 4044 echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5 4045 echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6 4046 if test $ac_cv_lib_opengl32_main = yes; then 4047 FOUND_opengl32=yes 4048 else 4049 "gl/gl.h" 4050 fi 4051 4052 if test "$FOUND_opengl32" = "yes" ; then 4053 LIBS="$LIBS -lopengl32" 4054 else 4055 echo "------------------" 4056 echo "opengl not found." 4057 echo "please install the opengl package which can be found at http://www.opengl.org" 4058 echo "------------------" 4059 exit -1 4060 fi 4061 4062 # cheking for GLU-header 4063 4064 for ac_header in GL/glu.h 3986 4065 do 3987 4066 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 4136 4215 done 4137 4216 4138 # checking for Windows openGl library 4139 echo "$as_me:$LINENO: checking for main in -lopengl32" >&5 4140 echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6 4141 if test "${ac_cv_lib_opengl32_main+set}" = set; then 4217 4218 # checking for libGLU 4219 echo "$as_me:$LINENO: checking for main in -lglu32" >&5 4220 echo $ECHO_N "checking for main in -lglu32... $ECHO_C" >&6 4221 if test "${ac_cv_lib_glu32_main+set}" = set; then 4142 4222 echo $ECHO_N "(cached) $ECHO_C" >&6 4143 4223 else 4144 4224 ac_check_lib_save_LIBS=$LIBS 4145 LIBS="-l opengl32 $LIBS"4225 LIBS="-lglu32 $LIBS" 4146 4226 cat >conftest.$ac_ext <<_ACEOF 4147 4227 /* confdefs.h. */ … … 4182 4262 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4183 4263 (exit $ac_status); }; }; then 4184 ac_cv_lib_ opengl32_main=yes4264 ac_cv_lib_glu32_main=yes 4185 4265 else 4186 4266 echo "$as_me: failed program was:" >&5 4187 4267 sed 's/^/| /' conftest.$ac_ext >&5 4188 4268 4189 ac_cv_lib_ opengl32_main=no4269 ac_cv_lib_glu32_main=no 4190 4270 fi 4191 4271 rm -f conftest.err conftest.$ac_objext \ … … 4193 4273 LIBS=$ac_check_lib_save_LIBS 4194 4274 fi 4195 echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5 4196 echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6 4197 if test $ac_cv_lib_opengl32_main = yes; then 4198 FOUND_opengl32=yes 4199 else 4200 "gl/gl.h" 4201 fi 4202 4203 if test "$FOUND_opengl32" = "yes" ; then 4204 LIBS="$LIBS -lopengl32" 4275 echo "$as_me:$LINENO: result: $ac_cv_lib_glu32_main" >&5 4276 echo "${ECHO_T}$ac_cv_lib_glu32_main" >&6 4277 if test $ac_cv_lib_glu32_main = yes; then 4278 FOUND_glu32=yes 4279 fi 4280 4281 if test "$FOUND_glu32" = "yes" ; then 4282 LIBS="$LIBS -lGLU32" 4205 4283 else 4206 4284 echo "------------------" 4207 echo " openglnot found."4208 echo "please install the opengl packagewhich can be found at http://www.opengl.org"4285 echo "GLU library not found." 4286 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" 4209 4287 echo "------------------" 4210 4288 exit -1 4211 4289 fi 4212 4290 4213 # cheking for GLU-header 4214 4215 for ac_header in GL/glu.h 4291 4292 # checking for mingw32 4293 echo "$as_me:$LINENO: checking for main in -lmingw32" >&5 4294 echo $ECHO_N "checking for main in -lmingw32... $ECHO_C" >&6 4295 if test "${ac_cv_lib_mingw32_main+set}" = set; then 4296 echo $ECHO_N "(cached) $ECHO_C" >&6 4297 else 4298 ac_check_lib_save_LIBS=$LIBS 4299 LIBS="-lmingw32 $LIBS" 4300 cat >conftest.$ac_ext <<_ACEOF 4301 /* confdefs.h. */ 4302 _ACEOF 4303 cat confdefs.h >>conftest.$ac_ext 4304 cat >>conftest.$ac_ext <<_ACEOF 4305 /* end confdefs.h. */ 4306 4307 4308 int 4309 main () 4310 { 4311 main (); 4312 ; 4313 return 0; 4314 } 4315 _ACEOF 4316 rm -f conftest.$ac_objext conftest$ac_exeext 4317 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4318 (eval $ac_link) 2>conftest.er1 4319 ac_status=$? 4320 grep -v '^ *+' conftest.er1 >conftest.err 4321 rm -f conftest.er1 4322 cat conftest.err >&5 4323 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4324 (exit $ac_status); } && 4325 { ac_try='test -z "$ac_c_werror_flag" 4326 || test ! -s conftest.err' 4327 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4328 (eval $ac_try) 2>&5 4329 ac_status=$? 4330 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4331 (exit $ac_status); }; } && 4332 { ac_try='test -s conftest$ac_exeext' 4333 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4334 (eval $ac_try) 2>&5 4335 ac_status=$? 4336 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4337 (exit $ac_status); }; }; then 4338 ac_cv_lib_mingw32_main=yes 4339 else 4340 echo "$as_me: failed program was:" >&5 4341 sed 's/^/| /' conftest.$ac_ext >&5 4342 4343 ac_cv_lib_mingw32_main=no 4344 fi 4345 rm -f conftest.err conftest.$ac_objext \ 4346 conftest$ac_exeext conftest.$ac_ext 4347 LIBS=$ac_check_lib_save_LIBS 4348 fi 4349 echo "$as_me:$LINENO: result: $ac_cv_lib_mingw32_main" >&5 4350 echo "${ECHO_T}$ac_cv_lib_mingw32_main" >&6 4351 if test $ac_cv_lib_mingw32_main = yes; then 4352 FOUND_mingw32=yes 4353 fi 4354 4355 if test $FOUND_mingw32 = "yes"; then 4356 LIBS="$LIBS -lmingw32" 4357 fi 4358 # checking for SDL-headers 4359 4360 for ac_header in SDL/SDL.h 4216 4361 do 4217 4362 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 4359 4504 4360 4505 else 4361 { { echo "$as_me:$LINENO: error: cannot find openglheaders" >&54362 echo "$as_me: error: cannot find openglheaders" >&2;}4506 { { echo "$as_me:$LINENO: error: cannot find SDL headers" >&5 4507 echo "$as_me: error: cannot find SDL headers" >&2;} 4363 4508 { (exit 1); exit 1; }; } 4364 4509 fi … … 4367 4512 4368 4513 4369 # checking for libGLU4370 echo "$as_me:$LINENO: checking for main in -l glu32" >&54371 echo $ECHO_N "checking for main in -l glu32... $ECHO_C" >&64372 if test "${ac_cv_lib_ glu32_main+set}" = set; then4514 #checking for libSDL 4515 echo "$as_me:$LINENO: checking for main in -lsdlmain" >&5 4516 echo $ECHO_N "checking for main in -lsdlmain... $ECHO_C" >&6 4517 if test "${ac_cv_lib_sdlmain_main+set}" = set; then 4373 4518 echo $ECHO_N "(cached) $ECHO_C" >&6 4374 4519 else 4375 4520 ac_check_lib_save_LIBS=$LIBS 4376 LIBS="-l glu32$LIBS"4521 LIBS="-lsdlmain $LIBS" 4377 4522 cat >conftest.$ac_ext <<_ACEOF 4378 4523 /* confdefs.h. */ … … 4413 4558 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4414 4559 (exit $ac_status); }; }; then 4415 ac_cv_lib_ glu32_main=yes4560 ac_cv_lib_sdlmain_main=yes 4416 4561 else 4417 4562 echo "$as_me: failed program was:" >&5 4418 4563 sed 's/^/| /' conftest.$ac_ext >&5 4419 4564 4420 ac_cv_lib_ glu32_main=no4565 ac_cv_lib_sdlmain_main=no 4421 4566 fi 4422 4567 rm -f conftest.err conftest.$ac_objext \ … … 4424 4569 LIBS=$ac_check_lib_save_LIBS 4425 4570 fi 4426 echo "$as_me:$LINENO: result: $ac_cv_lib_ glu32_main" >&54427 echo "${ECHO_T}$ac_cv_lib_ glu32_main" >&64428 if test $ac_cv_lib_ glu32_main = yes; then4429 FOUND_ glu32=yes4430 fi 4431 4432 if test "$FOUND_ glu32" = "yes" ; then4433 LIBS="$LIBS -l GLU32"4571 echo "$as_me:$LINENO: result: $ac_cv_lib_sdlmain_main" >&5 4572 echo "${ECHO_T}$ac_cv_lib_sdlmain_main" >&6 4573 if test $ac_cv_lib_sdlmain_main = yes; then 4574 FOUND_sdlmain=yes 4575 fi 4576 4577 if test "$FOUND_sdlmain" = "yes" ; then 4578 LIBS="$LIBS -lsdlmain" 4434 4579 else 4435 4580 echo "------------------" 4436 echo " GLUlibrary not found."4437 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"4581 echo "SDL library not found." 4582 echo "please install the SDL library, which can be found at http://www.libsdl.org" 4438 4583 echo "------------------" 4439 exit -14584 exit 1 4440 4585 fi 4441 4442 4443 # checking for mingw32 4444 echo "$as_me:$LINENO: checking for main in -lmingw32" >&5 4445 echo $ECHO_N "checking for main in -lmingw32... $ECHO_C" >&6 4446 if test "${ac_cv_lib_mingw32_main+set}" = set; then 4586 echo "$as_me:$LINENO: checking for main in -lsdl" >&5 4587 echo $ECHO_N "checking for main in -lsdl... $ECHO_C" >&6 4588 if test "${ac_cv_lib_sdl_main+set}" = set; then 4447 4589 echo $ECHO_N "(cached) $ECHO_C" >&6 4448 4590 else 4449 4591 ac_check_lib_save_LIBS=$LIBS 4450 LIBS="-l mingw32$LIBS"4592 LIBS="-lsdl $LIBS" 4451 4593 cat >conftest.$ac_ext <<_ACEOF 4452 4594 /* confdefs.h. */ … … 4487 4629 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4488 4630 (exit $ac_status); }; }; then 4489 ac_cv_lib_ mingw32_main=yes4631 ac_cv_lib_sdl_main=yes 4490 4632 else 4491 4633 echo "$as_me: failed program was:" >&5 4492 4634 sed 's/^/| /' conftest.$ac_ext >&5 4493 4635 4494 ac_cv_lib_ mingw32_main=no4636 ac_cv_lib_sdl_main=no 4495 4637 fi 4496 4638 rm -f conftest.err conftest.$ac_objext \ … … 4498 4640 LIBS=$ac_check_lib_save_LIBS 4499 4641 fi 4500 echo "$as_me:$LINENO: result: $ac_cv_lib_mingw32_main" >&5 4501 echo "${ECHO_T}$ac_cv_lib_mingw32_main" >&6 4502 if test $ac_cv_lib_mingw32_main = yes; then 4503 FOUND_mingw32=yes 4504 fi 4505 4506 if test $FOUND_mingw32 = "yes"; then 4507 LIBS="$LIBS -lmingw32" 4642 echo "$as_me:$LINENO: result: $ac_cv_lib_sdl_main" >&5 4643 echo "${ECHO_T}$ac_cv_lib_sdl_main" >&6 4644 if test $ac_cv_lib_sdl_main = yes; then 4645 FOUND_sdl=yes 4646 fi 4647 4648 if test "$FOUND_sdl" = "yes" ; then 4649 LIBS="$LIBS -lsdl" 4650 else 4651 echo "------------------" 4652 echo "SDL library not found." 4653 echo "please install the SDL library, which can be found at http://www.libsdl.org" 4654 echo "------------------" 4655 exit -1 4508 4656 fi 4509 # checking for SDL-headers 4510 4511 for ac_header in SDL/SDL.h 4657 4658 ;; 4659 4660 ### LINUX ### 4661 *Linux*) 4662 echo "Linux detected" 4663 4664 Linux="yes" 4665 4666 # checking gl header 4667 4668 for ac_header in GL/gl.h 4512 4669 do 4513 4670 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 4655 4812 4656 4813 else 4657 { { echo "$as_me:$LINENO: error: cannot find SDLheaders" >&54658 echo "$as_me: error: cannot find SDLheaders" >&2;}4814 { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5 4815 echo "$as_me: error: cannot find opengl headers" >&2;} 4659 4816 { (exit 1); exit 1; }; } 4660 4817 fi … … 4663 4820 4664 4821 4665 # checking for libSDL4666 echo "$as_me:$LINENO: checking for main in -lsdlmain" >&54667 echo $ECHO_N "checking for main in -l sdlmain... $ECHO_C" >&64668 if test "${ac_cv_lib_ sdlmain_main+set}" = set; then4822 # checking for Unix GL 4823 echo "$as_me:$LINENO: checking for main in -lGL" >&5 4824 echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 4825 if test "${ac_cv_lib_GL_main+set}" = set; then 4669 4826 echo $ECHO_N "(cached) $ECHO_C" >&6 4670 4827 else 4671 4828 ac_check_lib_save_LIBS=$LIBS 4672 LIBS="-l sdlmain$LIBS"4829 LIBS="-lGL $LIBS" 4673 4830 cat >conftest.$ac_ext <<_ACEOF 4674 4831 /* confdefs.h. */ … … 4709 4866 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4710 4867 (exit $ac_status); }; }; then 4711 ac_cv_lib_ sdlmain_main=yes4868 ac_cv_lib_GL_main=yes 4712 4869 else 4713 4870 echo "$as_me: failed program was:" >&5 4714 4871 sed 's/^/| /' conftest.$ac_ext >&5 4715 4872 4716 ac_cv_lib_ sdlmain_main=no4873 ac_cv_lib_GL_main=no 4717 4874 fi 4718 4875 rm -f conftest.err conftest.$ac_objext \ … … 4720 4877 LIBS=$ac_check_lib_save_LIBS 4721 4878 fi 4722 echo "$as_me:$LINENO: result: $ac_cv_lib_ sdlmain_main" >&54723 echo "${ECHO_T}$ac_cv_lib_ sdlmain_main" >&64724 if test $ac_cv_lib_ sdlmain_main = yes; then4725 FOUND_ sdlmain=yes4726 fi 4727 4728 if test "$FOUND_sdlmain" = "yes" ; then4729 LIBS="$LIBS -lsdlmain"4730 4879 echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 4880 echo "${ECHO_T}$ac_cv_lib_GL_main" >&6 4881 if test $ac_cv_lib_GL_main = yes; then 4882 FOUND_GL=yes 4883 fi 4884 4885 if test "$FOUND_GL" = "yes" ; then 4886 LIBS="$LIBS -lGL" 4887 else 4731 4888 echo "------------------" 4732 echo "SDL library not found." 4733 echo "please install the SDL library, which can be found at http://www.libsdl.org" 4734 echo "------------------" 4735 exit 1 4736 fi 4737 echo "$as_me:$LINENO: checking for main in -lsdl" >&5 4738 echo $ECHO_N "checking for main in -lsdl... $ECHO_C" >&6 4739 if test "${ac_cv_lib_sdl_main+set}" = set; then 4740 echo $ECHO_N "(cached) $ECHO_C" >&6 4741 else 4742 ac_check_lib_save_LIBS=$LIBS 4743 LIBS="-lsdl $LIBS" 4744 cat >conftest.$ac_ext <<_ACEOF 4745 /* confdefs.h. */ 4746 _ACEOF 4747 cat confdefs.h >>conftest.$ac_ext 4748 cat >>conftest.$ac_ext <<_ACEOF 4749 /* end confdefs.h. */ 4750 4751 4752 int 4753 main () 4754 { 4755 main (); 4756 ; 4757 return 0; 4758 } 4759 _ACEOF 4760 rm -f conftest.$ac_objext conftest$ac_exeext 4761 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4762 (eval $ac_link) 2>conftest.er1 4763 ac_status=$? 4764 grep -v '^ *+' conftest.er1 >conftest.err 4765 rm -f conftest.er1 4766 cat conftest.err >&5 4767 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4768 (exit $ac_status); } && 4769 { ac_try='test -z "$ac_c_werror_flag" 4770 || test ! -s conftest.err' 4771 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4772 (eval $ac_try) 2>&5 4773 ac_status=$? 4774 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4775 (exit $ac_status); }; } && 4776 { ac_try='test -s conftest$ac_exeext' 4777 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4778 (eval $ac_try) 2>&5 4779 ac_status=$? 4780 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4781 (exit $ac_status); }; }; then 4782 ac_cv_lib_sdl_main=yes 4783 else 4784 echo "$as_me: failed program was:" >&5 4785 sed 's/^/| /' conftest.$ac_ext >&5 4786 4787 ac_cv_lib_sdl_main=no 4788 fi 4789 rm -f conftest.err conftest.$ac_objext \ 4790 conftest$ac_exeext conftest.$ac_ext 4791 LIBS=$ac_check_lib_save_LIBS 4792 fi 4793 echo "$as_me:$LINENO: result: $ac_cv_lib_sdl_main" >&5 4794 echo "${ECHO_T}$ac_cv_lib_sdl_main" >&6 4795 if test $ac_cv_lib_sdl_main = yes; then 4796 FOUND_sdl=yes 4797 fi 4798 4799 if test "$FOUND_sdl" = "yes" ; then 4800 LIBS="$LIBS -lsdl" 4801 else 4802 echo "------------------" 4803 echo "SDL library not found." 4804 echo "please install the SDL library, which can be found at http://www.libsdl.org" 4889 echo "opengl not found." 4890 echo "please install the opengl package which can be found at http://www.opengl.org" 4805 4891 echo "------------------" 4806 4892 exit -1 4807 fi 4808 4809 ;; 4810 4811 ### LINUX ### 4812 *Linux*) 4813 echo "Linux detected" 4814 4815 Linux="yes" 4816 4817 # checking gl header (has to be here because of a Linux error) 4818 4819 for ac_header in GL/gl.h 4893 fi 4894 4895 # cheking for GLU-header 4896 4897 for ac_header in GL/glu.h 4820 4898 do 4821 4899 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 4971 5049 4972 5050 4973 # checking for Unix GL 4974 echo "$as_me:$LINENO: checking for main in -lGL" >&5 4975 echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 4976 if test "${ac_cv_lib_GL_main+set}" = set; then 5051 echo "$as_me:$LINENO: checking for gluProject in -lGLU" >&5 5052 echo $ECHO_N "checking for gluProject in -lGLU... $ECHO_C" >&6 5053 if test "${ac_cv_lib_GLU_gluProject+set}" = set; then 4977 5054 echo $ECHO_N "(cached) $ECHO_C" >&6 4978 5055 else 4979 5056 ac_check_lib_save_LIBS=$LIBS 4980 LIBS="-lGL $LIBS"5057 LIBS="-lGLU $LIBS" 4981 5058 cat >conftest.$ac_ext <<_ACEOF 4982 5059 /* confdefs.h. */ … … 4986 5063 /* end confdefs.h. */ 4987 5064 4988 5065 /* Override any gcc2 internal prototype to avoid an error. */ 5066 #ifdef __cplusplus 5067 extern "C" 5068 #endif 5069 /* We use char because int might match the return type of a gcc2 5070 builtin and then its argument prototype would still apply. */ 5071 char gluProject (); 4989 5072 int 4990 5073 main () 4991 5074 { 4992 main();5075 gluProject (); 4993 5076 ; 4994 5077 return 0; … … 5017 5100 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5018 5101 (exit $ac_status); }; }; then 5019 ac_cv_lib_GL _main=yes5102 ac_cv_lib_GLU_gluProject=yes 5020 5103 else 5021 5104 echo "$as_me: failed program was:" >&5 5022 5105 sed 's/^/| /' conftest.$ac_ext >&5 5023 5106 5024 ac_cv_lib_GL _main=no5107 ac_cv_lib_GLU_gluProject=no 5025 5108 fi 5026 5109 rm -f conftest.err conftest.$ac_objext \ … … 5028 5111 LIBS=$ac_check_lib_save_LIBS 5029 5112 fi 5030 echo "$as_me:$LINENO: result: $ac_cv_lib_GL _main" >&55031 echo "${ECHO_T}$ac_cv_lib_GL _main" >&65032 if test $ac_cv_lib_GL _main= yes; then5033 FOUND_GL =yes5034 fi 5035 5036 if test "$FOUND_GL" = "yes" ; then5037 LIBS="$LIBS -lGL"5038 else5113 echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluProject" >&5 5114 echo "${ECHO_T}$ac_cv_lib_GLU_gluProject" >&6 5115 if test $ac_cv_lib_GLU_gluProject = yes; then 5116 FOUND_GLU=yes 5117 fi 5118 5119 if test "$FOUND_GLU" = "yes" ; then 5120 LIBS="$LIBS -lGLU" 5121 else 5039 5122 echo "------------------" 5040 echo " openglnot found."5041 echo "please install the opengl packagewhich can be found at http://www.opengl.org"5123 echo "GLU library not found." 5124 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" 5042 5125 echo "------------------" 5043 5126 exit -1 5044 fi5045 5046 # che king for GLU-header5047 5048 for ac_header in GL/glu.h5127 fi 5128 5129 # checking for SDL-headers 5130 5131 for ac_header in SDL/SDL.h 5049 5132 do 5050 5133 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 5192 5275 5193 5276 else 5194 { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&55195 echo "$as_me: error: cannot find opengl headers" >&2;}5196 { (exit 1); exit 1; }; }5197 fi5198 5199 done5200 5201 5202 echo "$as_me:$LINENO: checking for gluProject in -lGLU" >&55203 echo $ECHO_N "checking for gluProject in -lGLU... $ECHO_C" >&65204 if test "${ac_cv_lib_GLU_gluProject+set}" = set; then5205 echo $ECHO_N "(cached) $ECHO_C" >&65206 else5207 ac_check_lib_save_LIBS=$LIBS5208 LIBS="-lGLU $LIBS"5209 cat >conftest.$ac_ext <<_ACEOF5210 /* confdefs.h. */5211 _ACEOF5212 cat confdefs.h >>conftest.$ac_ext5213 cat >>conftest.$ac_ext <<_ACEOF5214 /* end confdefs.h. */5215 5216 /* Override any gcc2 internal prototype to avoid an error. */5217 #ifdef __cplusplus5218 extern "C"5219 #endif5220 /* We use char because int might match the return type of a gcc25221 builtin and then its argument prototype would still apply. */5222 char gluProject ();5223 int5224 main ()5225 {5226 gluProject ();5227 ;5228 return 0;5229 }5230 _ACEOF5231 rm -f conftest.$ac_objext conftest$ac_exeext5232 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&55233 (eval $ac_link) 2>conftest.er15234 ac_status=$?5235 grep -v '^ *+' conftest.er1 >conftest.err5236 rm -f conftest.er15237 cat conftest.err >&55238 echo "$as_me:$LINENO: \$? = $ac_status" >&55239 (exit $ac_status); } &&5240 { ac_try='test -z "$ac_c_werror_flag"5241 || test ! -s conftest.err'5242 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&55243 (eval $ac_try) 2>&55244 ac_status=$?5245 echo "$as_me:$LINENO: \$? = $ac_status" >&55246 (exit $ac_status); }; } &&5247 { ac_try='test -s conftest$ac_exeext'5248 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&55249 (eval $ac_try) 2>&55250 ac_status=$?5251 echo "$as_me:$LINENO: \$? = $ac_status" >&55252 (exit $ac_status); }; }; then5253 ac_cv_lib_GLU_gluProject=yes5254 else5255 echo "$as_me: failed program was:" >&55256 sed 's/^/| /' conftest.$ac_ext >&55257 5258 ac_cv_lib_GLU_gluProject=no5259 fi5260 rm -f conftest.err conftest.$ac_objext \5261 conftest$ac_exeext conftest.$ac_ext5262 LIBS=$ac_check_lib_save_LIBS5263 fi5264 echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluProject" >&55265 echo "${ECHO_T}$ac_cv_lib_GLU_gluProject" >&65266 if test $ac_cv_lib_GLU_gluProject = yes; then5267 FOUND_GLU=yes5268 fi5269 5270 if test "$FOUND_GLU" = "yes" ; then5271 LIBS="$LIBS -lGLU"5272 else5273 echo "------------------"5274 echo "GLU library not found."5275 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"5276 echo "------------------"5277 exit -15278 fi5279 5280 # checking for SDL-headers5281 5282 for ac_header in SDL/SDL.h5283 do5284 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`5285 if eval "test \"\${$as_ac_Header+set}\" = set"; then5286 echo "$as_me:$LINENO: checking for $ac_header" >&55287 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&65288 if eval "test \"\${$as_ac_Header+set}\" = set"; then5289 echo $ECHO_N "(cached) $ECHO_C" >&65290 fi5291 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&55292 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&65293 else5294 # Is the header compilable?5295 echo "$as_me:$LINENO: checking $ac_header usability" >&55296 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&65297 cat >conftest.$ac_ext <<_ACEOF5298 /* confdefs.h. */5299 _ACEOF5300 cat confdefs.h >>conftest.$ac_ext5301 cat >>conftest.$ac_ext <<_ACEOF5302 /* end confdefs.h. */5303 $ac_includes_default5304 #include <$ac_header>5305 _ACEOF5306 rm -f conftest.$ac_objext5307 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&55308 (eval $ac_compile) 2>conftest.er15309 ac_status=$?5310 grep -v '^ *+' conftest.er1 >conftest.err5311 rm -f conftest.er15312 cat conftest.err >&55313 echo "$as_me:$LINENO: \$? = $ac_status" >&55314 (exit $ac_status); } &&5315 { ac_try='test -z "$ac_c_werror_flag"5316 || test ! -s conftest.err'5317 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&55318 (eval $ac_try) 2>&55319 ac_status=$?5320 echo "$as_me:$LINENO: \$? = $ac_status" >&55321 (exit $ac_status); }; } &&5322 { ac_try='test -s conftest.$ac_objext'5323 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&55324 (eval $ac_try) 2>&55325 ac_status=$?5326 echo "$as_me:$LINENO: \$? = $ac_status" >&55327 (exit $ac_status); }; }; then5328 ac_header_compiler=yes5329 else5330 echo "$as_me: failed program was:" >&55331 sed 's/^/| /' conftest.$ac_ext >&55332 5333 ac_header_compiler=no5334 fi5335 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext5336 echo "$as_me:$LINENO: result: $ac_header_compiler" >&55337 echo "${ECHO_T}$ac_header_compiler" >&65338 5339 # Is the header present?5340 echo "$as_me:$LINENO: checking $ac_header presence" >&55341 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&65342 cat >conftest.$ac_ext <<_ACEOF5343 /* confdefs.h. */5344 _ACEOF5345 cat confdefs.h >>conftest.$ac_ext5346 cat >>conftest.$ac_ext <<_ACEOF5347 /* end confdefs.h. */5348 #include <$ac_header>5349 _ACEOF5350 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&55351 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er15352 ac_status=$?5353 grep -v '^ *+' conftest.er1 >conftest.err5354 rm -f conftest.er15355 cat conftest.err >&55356 echo "$as_me:$LINENO: \$? = $ac_status" >&55357 (exit $ac_status); } >/dev/null; then5358 if test -s conftest.err; then5359 ac_cpp_err=$ac_c_preproc_warn_flag5360 ac_cpp_err=$ac_cpp_err$ac_c_werror_flag5361 else5362 ac_cpp_err=5363 fi5364 else5365 ac_cpp_err=yes5366 fi5367 if test -z "$ac_cpp_err"; then5368 ac_header_preproc=yes5369 else5370 echo "$as_me: failed program was:" >&55371 sed 's/^/| /' conftest.$ac_ext >&55372 5373 ac_header_preproc=no5374 fi5375 rm -f conftest.err conftest.$ac_ext5376 echo "$as_me:$LINENO: result: $ac_header_preproc" >&55377 echo "${ECHO_T}$ac_header_preproc" >&65378 5379 # So? What about this header?5380 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in5381 yes:no: )5382 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&55383 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}5384 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&55385 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}5386 ac_header_preproc=yes5387 ;;5388 no:yes:* )5389 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&55390 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}5391 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&55392 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}5393 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&55394 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}5395 { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&55396 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}5397 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&55398 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}5399 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&55400 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}5401 (5402 cat <<\_ASBOX5403 ## ------------------------------------------- ##5404 ## Report this to orxonox-dev@mail.datacore.ch ##5405 ## ------------------------------------------- ##5406 _ASBOX5407 ) |5408 sed "s/^/$as_me: WARNING: /" >&25409 ;;5410 esac5411 echo "$as_me:$LINENO: checking for $ac_header" >&55412 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&65413 if eval "test \"\${$as_ac_Header+set}\" = set"; then5414 echo $ECHO_N "(cached) $ECHO_C" >&65415 else5416 eval "$as_ac_Header=\$ac_header_preproc"5417 fi5418 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&55419 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&65420 5421 fi5422 if test `eval echo '${'$as_ac_Header'}'` = yes; then5423 cat >>confdefs.h <<_ACEOF5424 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 15425 _ACEOF5426 5427 else5428 5277 { { echo "$as_me:$LINENO: error: cannot find SDL headers" >&5 5429 5278 echo "$as_me: error: cannot find SDL headers" >&2;} … … 5506 5355 fi 5507 5356 5508 ;; 5509 *) 5510 mingw="no" 5511 ;; 5512 esac 5513 echo "$as_me:$LINENO: result: $mingw" >&5 5514 echo "${ECHO_T}$mingw" >&6 5515 5516 5517 #### Checking for LIBraries. 5518 5519 # FIXME: Replace `main' with a function in `-lOSMesa': 5357 # FIXME: Replace `main' with a function in `-lOSMesa': 5520 5358 5521 5359 echo "$as_me:$LINENO: checking for main in -lOSMesa" >&5 … … 5586 5424 fi 5587 5425 5588 # FIXME: Replace `main' with a function in `-lX11':5426 # FIXME: Replace `main' with a function in `-lX11': 5589 5427 5590 5428 echo "$as_me:$LINENO: checking for main in -lX11" >&5 … … 5655 5493 fi 5656 5494 5657 # FIXME: Replace `main' with a function in `-lXt':5495 # FIXME: Replace `main' with a function in `-lXt': 5658 5496 5659 5497 echo "$as_me:$LINENO: checking for main in -lXt" >&5 … … 5724 5562 fi 5725 5563 5564 ;; 5565 *) 5566 mingw="no" 5567 ;; 5568 esac 5569 5570 5571 5726 5572 5727 5573 5728 5574 #checking for pthread libs 5729 echo "$as_me:$LINENO: checking for main in -lpthread" >&55575 echo "$as_me:$LINENO: checking for main in -lpthread" >&5 5730 5576 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6 5731 5577 if test "${ac_cv_lib_pthread_main+set}" = set; then … … 5789 5635 fi 5790 5636 5791 if test "$FOUND_pthread" = "yes" ; then5637 if test "$FOUND_pthread" = "yes" ; then 5792 5638 LIBS="$LIBS -lpthread" 5793 fi5639 fi 5794 5640 5795 5641 -
orxonox/branches/osX/configure.ac
r2879 r2977 16 16 17 17 18 AC_CHECK_HEADERS(,,,) 19 20 18 AC_HEADER_STDC 21 19 22 20 ### CHECKING FOR SYSTEM ### … … 35 33 #done before loop 36 34 37 # checking gl header (has to be here because of a Linux error)35 # checking gl header 38 36 AC_CHECK_HEADERS(GL/gl.h ,, 39 37 [AC_MSG_ERROR([cannot find opengl headers]) ]) … … 106 104 Linux="yes" 107 105 108 # checking gl header (has to be here because of a Linux error)106 # checking gl header 109 107 AC_CHECK_HEADERS(GL/gl.h ,, 110 108 [AC_MSG_ERROR([cannot find opengl headers]) ]) … … 152 150 fi 153 151 152 # FIXME: Replace `main' with a function in `-lOSMesa': 153 AC_CHECK_LIB([OSMesa], [main]) 154 # FIXME: Replace `main' with a function in `-lX11': 155 AC_CHECK_LIB([X11], [main]) 156 # FIXME: Replace `main' with a function in `-lXt': 157 AC_CHECK_LIB([Xt], [main]) 154 158 ;; 155 159 *) … … 157 161 ;; 158 162 esac 159 AC_MSG_RESULT([$mingw]) 163 160 164 AC_SUBST(MSBITFIELDS) 161 165 162 #### Checking for LIBraries.163 164 # FIXME: Replace `main' with a function in `-lOSMesa':165 AC_CHECK_LIB([OSMesa], [main])166 # FIXME: Replace `main' with a function in `-lX11':167 AC_CHECK_LIB([X11], [main])168 # FIXME: Replace `main' with a function in `-lXt':169 AC_CHECK_LIB([Xt], [main])170 166 171 167 172 168 #checking for pthread libs 173 AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)174 if test "$FOUND_pthread" = "yes" ; then169 AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) 170 if test "$FOUND_pthread" = "yes" ; then 175 171 LIBS="$LIBS -lpthread" 176 fi172 fi 177 173 178 174 … … 180 176 181 177 # FIXME: Replace `main' with a function in `-lm': 182 AC_CHECK_LIB([m], [main])178 AC_CHECK_LIB([m], [main]) 183 179 184 180 LIBS="$LIBS `pkg-config --libs gtk+-2.0`" -
orxonox/branches/osX/importer/Makefile.am
r2776 r2977 6 6 7 7 bin_PROGRAMS=importer 8 importer_SOURCES=framework.cc windowHandler.cc object.cc array.cc material.cc8 importer_SOURCES=framework.cc windowHandler.cc vector.cc object.cc array.cc material.cc 9 9 10 noinst_HEADERS= windowHandler.h object.h array.h material.h10 noinst_HEADERS=framework.h windowHandler.h vector.h object.h array.h material.h 11 11 12 12 -
orxonox/branches/osX/importer/Makefile.in
r2776 r2977 53 53 PROGRAMS = $(bin_PROGRAMS) 54 54 am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \ 55 object.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) 55 vector.$(OBJEXT) object.$(OBJEXT) array.$(OBJEXT) \ 56 material.$(OBJEXT) 56 57 importer_OBJECTS = $(am_importer_OBJECTS) 57 58 importer_LDADD = $(LDADD) … … 61 62 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/framework.Po \ 62 63 @AMDEP_TRUE@ ./$(DEPDIR)/material.Po ./$(DEPDIR)/object.Po \ 63 @AMDEP_TRUE@ ./$(DEPDIR)/ windowHandler.Po64 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po 64 65 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 65 66 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 151 152 AM_CXXFLAGS = "-I/usr/X11R6/include" 152 153 AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS) 153 importer_SOURCES = framework.cc windowHandler.cc object.cc array.cc material.cc154 noinst_HEADERS = windowHandler.h object.h array.h material.h154 importer_SOURCES = framework.cc windowHandler.cc vector.cc object.cc array.cc material.cc 155 noinst_HEADERS = framework.h windowHandler.h vector.h object.h array.h material.h 155 156 all: all-am 156 157 … … 223 224 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ 224 225 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@ 226 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 225 227 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowHandler.Po@am__quote@ 226 228 -
orxonox/branches/osX/importer/framework.cc
r2863 r2977 1 #include "windowHandler.h" // Include the Whandler Basecode 2 #include "object.h" 1 #include "framework.h" 3 2 4 3 int verbose = 1; 5 WindowHandler wHandler; // Create an instance of the whandler basecode class6 Object* obj;7 float rotator = 0.0;8 GLfloat whiteLight[] = {1.0, 1.0, 0.0,1.0};9 4 10 5 void DrawGLScene() 11 6 { 12 rotator +=.001; 13 7 currFrame = SDL_GetTicks(); 8 dt = currFrame - lastFrame; 9 if (dt == 0) 10 dist += (zoomTo-dist)/500; 11 else 12 dist += (zoomTo-dist)/500 *(float)dt; 13 14 rotatorP += rotatorV *(float)dt; 15 16 14 17 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 15 18 glLoadIdentity(); // Reset the view … … 17 20 glMatrixMode(GL_PROJECTION); 18 21 glLoadIdentity(); 19 gluPerspective(45.0f,500/375,0.1f,100.0f); 20 gluLookAt (5*sin(rotator),7.5,5*cos(rotator), 0,0,0, 0,1,0); 21 whiteLight[1] = .5+.5*sin(rotator*10); 22 whiteLight[2] = .5+.5*sin(rotator*10); 23 24 GLfloat lightPosition[] = {10.0*sin(rotator*10), 10, 19.0, 0.0}; 25 glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); 26 27 glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight); 22 gluPerspective(45.0f,500/375,0.1f,dist * 5.0f); 23 gluLookAt (0, dist , dist, 0,0,0, up.x,up.y,up.z); 24 25 glMatrixMode(GL_MODELVIEW); 26 glPushMatrix(); 27 // glRotatef (180, dir.x, dir.y, dir.z); 28 glMultMatrixf (*matQ); 28 29 obj->draw(); 29 30 31 glPopMatrix(); 32 30 33 SDL_GL_SwapBuffers(); // Swap the buffers 34 lastFrame = currFrame; 31 35 } 32 36 … … 46 50 return 0; 47 51 } 52 53 printf ("%i, %i\n", wHandler.screen->w, wHandler.screen->h); 48 54 if (argc>=3) 49 55 obj = new Object (argv[1], atof(argv[2])); … … 53 59 obj = new Object(); 54 60 61 M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); 62 rotAxis = Vector (0.0,1.0,0.0); 63 rotAngle = 0; 64 65 matQ[0][0] = matQ[1][1] = matQ[2][2] = matQ[3][3] = 1; 66 rotQ = Quaternion (rotAngle, rotAxis); 67 rotQlast = rotQ; 68 dir = Vector (0.0, 0.0, 1.0); 69 up = Vector (0.0, 1.0, 0.0); 70 71 glEnable(GL_LIGHTING); 72 glEnable(GL_DEPTH_TEST); 73 74 GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0}; 75 GLfloat light0Position[] = {10.0, 10.0, 10.0, 0.0}; 76 GLfloat light1Position[] = {-10.0, -7.0, -6.0, 0.0}; 55 77 GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0}; 78 79 glEnable(GL_LIGHT0); 80 glLightfv(GL_LIGHT0, GL_POSITION, light0Position); 56 81 glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight); 57 82 glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight); 58 glEnable(GL_LIGHTING); 59 glEnable(GL_LIGHT0); 60 glEnable(GL_DEPTH_TEST); 61 83 84 glEnable(GL_LIGHT1); 85 glLightfv(GL_LIGHT1, GL_POSITION, light1Position); 86 glLightfv(GL_LIGHT1, GL_DIFFUSE, whiteLight); 87 glLightfv(GL_LIGHT1, GL_SPECULAR, whiteLight); 88 89 rotatorP = .0; 90 rotatorV = .0; 91 dist = 5.0; 92 zoomTo = dist; 62 93 // Build the font from a TGA image font.tga in the data directory 63 94 // Hide the mouse cursor 64 SDL_ShowCursor(0); 95 SDL_ShowCursor(2); 96 mouse1Down = false; 65 97 66 98 // This is the main loop for the entire program and it will run until done==TRUE … … 73 105 while ( SDL_PollEvent(&event) ) { 74 106 switch (event.type) { 107 case SDL_MOUSEMOTION: 108 if (verbose >=3) 109 printf("Mouse motion about %d,%d Pixels to (%d,%d).\n", 110 event.motion.xrel, event.motion.yrel, 111 event.motion.x, event.motion.y); 112 // TRACKBALL 113 if (mouse1Down) 114 { 115 int mX = event.button.x; 116 int mY = event.button.y; 117 int wH = wHandler.screen->h; 118 int wW = wHandler.screen->w; 119 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 120 // printf ("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z); 121 p2 = tmpV-M; 122 p2.y = -p2.y; 123 rotAxis = p1.cross(p2); 124 // printf ("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z); 125 126 // in case that there is no rotation-axis defined 127 if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0) 128 { 129 rotAxis.normalize(); 130 // printf ("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle); 131 132 rotAngle = angle_rad (p1, p2); 133 rotQ = Quaternion (rotAngle, rotAxis); 134 rotQ = rotQ * rotQlast; 135 rotQ.matrix (matQ); 136 // dir = rotQ.apply(dir); 137 // dir.normalize(); 138 // printf ("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle); 139 } 140 rotQlast = rotQ; 141 p1 = p2; 142 143 } 144 break; 145 case SDL_MOUSEBUTTONDOWN: 146 if (event.button.button == 4) 147 { 148 printf("MouseWheel up\n"); 149 zoomTo *= .5; 150 } 151 else if (event.button.button == 5) 152 { 153 printf("MouseWheel down\n"); 154 zoomTo *= 2.0; 155 } 156 else if (event.button.button == 1) 157 { 158 mouse1Down = true; 159 int mX = event.button.x; 160 int mY = event.button.y; 161 int wH = wHandler.screen->h; 162 int wW = wHandler.screen->w; 163 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 164 p1 = tmpV-M; 165 p1.y = -p1.y; 166 167 } 168 else 169 { 170 printf("MouseButton %d pressed at (%d,%d).\n", 171 event.button.button, event.button.x, event.button.y); 172 rotatorV = ( (float)wHandler.screen->w/2 -event.button.x) / (float)wHandler.screen->w / 100.0; 173 } 174 175 break; 176 case SDL_MOUSEBUTTONUP: 177 if (event.button.button == 4); 178 else if (event.button.button == 5); 179 else if (event.button.button == 1) 180 mouse1Down =false; 181 else 182 { 183 printf("MouseButton %d released at (%d,%d).\n", 184 event.button.button, event.button.x, event.button.y); 185 } 186 break; 187 75 188 // If a quit event was recieved 76 189 case SDL_QUIT: … … 81 194 break; 82 195 } 196 197 83 198 } 84 199 -
orxonox/branches/osX/importer/object.cc
r2863 r2977 48 48 \param scaling The factor that the object will be scaled with. 49 49 */ 50 51 50 Object::Object(char* fileName, float scaling) 52 51 { … … 90 89 groupCount = 0; 91 90 92 initGroup ( currentGroup);91 initGroup (firstGroup); 93 92 mtlFileName = ""; 94 93 scaleFactor = 1; 95 94 material = new Material(); 96 95 97 glEnableClientState (GL_VERTEX_ARRAY);96 // glEnableClientState (GL_VERTEX_ARRAY); 98 97 // glEnableClientState (GL_NORMAL_ARRAY); 99 98 // glEnableClientState (GL_TEXTURE_COORD_ARRAY); … … 226 225 group->name = ""; 227 226 group->faceMode = -1; 228 group->faceCount = 0;227 group->faceCount = 0; 229 228 if ((group->listNumber = glGenLists(1)) == 0 ) 230 229 { … … 237 236 group->firstVertex = 0; 238 237 group->firstNormal = 0; 239 group->first Normal= 0;238 group->firstVertexTexture = 0; 240 239 } 241 240 else … … 265 264 glEndList(); 266 265 } 266 267 267 /** 268 268 \brief deletes the Arrays of the Group to save space. … … 295 295 } 296 296 objFileName = fileName; 297 char Buffer[ 500];297 char Buffer[10000]; 298 298 while(!OBJ_FILE->eof()) 299 299 { 300 OBJ_FILE->getline(Buffer, 500);300 OBJ_FILE->getline(Buffer, 10000); 301 301 if (verbose >=4) 302 302 printf ("Read input line: %s\n",Buffer); … … 377 377 { 378 378 currentGroup->vertices->finalizeArray(); 379 glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());379 // glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray()); 380 380 currentGroup->normals->finalizeArray(); 381 glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());381 // glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray()); 382 382 currentGroup->vTexture->finalizeArray(); 383 383 } … … 385 385 readingVertices = false; 386 386 currentGroup->faceCount++; 387 char subbuffer1[20]; 388 char subbuffer2[20]; 389 char subbuffer3[20]; 390 char subbuffer4[20] =""; 391 sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 392 if (!strcmp(subbuffer4, "")) 387 388 int elemCount = 0; 389 390 FaceElement* firstElem = new FaceElement; 391 FaceElement* tmpElem = firstElem; 392 393 394 while(strcmp (faceString, "\0")) 395 { 396 if (elemCount>0) 397 tmpElem = tmpElem->next = new FaceElement; 398 tmpElem->next = NULL; 399 400 401 sscanf (faceString, "%s", tmpElem->value); 402 faceString += strlen(tmpElem->value); 403 if (strcmp (faceString, "\0")) 404 faceString++; 405 elemCount++; 406 407 408 } 409 410 411 if (elemCount == 3) 393 412 { 394 413 if (currentGroup->faceMode != 3) … … 401 420 currentGroup->faceMode = 3; 402 421 if (verbose >=3) 403 printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3); 404 addGLElement(subbuffer1); 405 addGLElement(subbuffer2); 406 addGLElement(subbuffer3); 407 return true; 408 } 409 else 422 printf ("found triag.\n"); 423 } 424 425 else if (elemCount == 4) 410 426 { 411 427 if (currentGroup->faceMode != 4) … … 417 433 currentGroup->faceMode = 4; 418 434 if (verbose >=3 ) 419 printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 420 addGLElement(subbuffer1); 421 addGLElement(subbuffer2); 422 addGLElement(subbuffer3); 423 addGLElement(subbuffer4); 424 return true; 425 } 435 printf ("found quad.\n"); 436 } 437 438 else if (elemCount > 4) 439 { 440 if (currentGroup->faceMode != -1) 441 glEnd(); 442 glBegin(GL_POLYGON); 443 if (verbose >=3) 444 printf ("Polygon with %i faces found.", elemCount); 445 currentGroup->faceMode = elemCount; 446 } 447 448 tmpElem = firstElem; 449 FaceElement* delElem; 450 while (tmpElem != NULL) 451 { 452 // printf ("%s\n", tmpElem->value); 453 addGLElement(tmpElem->value); 454 delElem = tmpElem; 455 tmpElem = tmpElem->next; 456 delete delElem; 457 } 458 426 459 } 427 460 … … 442 475 443 476 char* texture; 444 texture = strstr (vertex, "/"); 445 texture[0] = '\0'; 446 texture ++; 447 if (verbose>=3) 448 printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount()); 449 glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2); 450 451 char* normal; 452 if ((normal = strstr (texture, "/")) !=NULL) 453 { 454 normal[0] = '\0'; 455 normal ++; 456 //glArrayElement(atoi(vertex)-1); 457 glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3); 477 if ((texture = strstr (vertex, "/")) != NULL) 478 { 479 texture[0] = '\0'; 480 texture ++; 481 if (verbose>=3) 482 printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*2, currentGroup->vTexture->getCount()); 483 glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2); 484 485 char* normal; 486 if ((normal = strstr (texture, "/")) !=NULL) 487 { 488 normal[0] = '\0'; 489 normal ++; 490 //glArrayElement(atoi(vertex)-1); 491 glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3); 492 } 458 493 } 459 494 if (verbose>=3) … … 603 638 \param matString the Material that will be set. 604 639 */ 605 606 640 bool Object::readUseMtl (char* matString) 607 641 { … … 635 669 readVertex ("-0.500000 -0.500000 -0.500000"); 636 670 readVertex ("0.500000 -0.500000 -0.500000"); 671 637 672 readVertexTexture ("0.000000 0.000000"); 638 673 readVertexTexture ("1.000000 0.000000"); -
orxonox/branches/osX/importer/object.h
r2863 r2977 18 18 extern int verbose; //!< fill be removed and added again as a verbose-class 19 19 20 21 struct FaceElement 22 { 23 char value[20]; 24 FaceElement* next; 25 }; 20 26 21 27 //! Class that handles 3D-Objects. it can also read them in and display them. -
orxonox/branches/osX/importer/windowHandler.cc
r2759 r2977 3 3 #include "windowHandler.h" 4 4 #include <stdio.h> 5 void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) 5 void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window 6 6 { 7 if (height==0) 7 if (height==0) // Prevent A Divide By Zero By 8 8 { 9 height=1; 9 height=1;// Making Height Equal One 10 10 } 11 11 12 glViewport(0,0,width,height); 12 glViewport(0,0,width,height); // Reset The Current Viewport 13 13 14 15 glMatrixMode(GL_PROJECTION); 14 15 glMatrixMode(GL_PROJECTION); // Select The Projection Matrix 16 16 glLoadIdentity(); 17 17 … … 21 21 gluLookAt (0,0,15, 0,0,0, 0,1,0); 22 22 23 glMatrixMode(GL_MODELVIEW); 24 glLoadIdentity(); 23 glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix 24 glLoadIdentity(); // Reset The Modelview Matrix 25 25 26 26 } … … 29 29 int WindowHandler::InitGL(GLvoid) // All Setup For OpenGL Goes Here 30 30 { 31 glEnable(GL_TEXTURE_2D); 32 glShadeModel(GL_SMOOTH); 33 glClearColor(0.00f, 0.00f, 0.00f, 0.0f); 34 glClearDepth(1.0f); 35 glEnable(GL_DEPTH_TEST); 36 glDepthFunc(GL_LEQUAL); 37 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 31 glEnable(GL_TEXTURE_2D); // Enable Texture Mapping 32 glShadeModel(GL_SMOOTH); // Enable Smooth Shading 33 glClearColor(0.00f, 0.00f, 0.00f, 0.0f); // Black Background 34 glClearDepth(1.0f); // Depth Buffer Setup 35 glEnable(GL_DEPTH_TEST); // Enables Depth Testing 36 glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do 37 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations 38 38 39 39 return TRUE; … … 41 41 42 42 43 GLvoid WindowHandler::KillGLWindow(GLvoid) 43 GLvoid WindowHandler::KillGLWindow(GLvoid) // Properly Kill The Window 44 44 { 45 45 SDL_Quit(); … … 63 63 } 64 64 SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 1 ); 65 if ( SDL_SetVideoMode(width, height, 0, flags) == NULL ) {65 if ( (screen = SDL_SetVideoMode(width, height, 0, flags)) == NULL ) { 66 66 return FALSE; 67 67 } 68 68 SDL_GL_GetAttribute( SDL_GL_STENCIL_SIZE, &size); 69 69 70 ReSizeGLScene(width, height); 70 ReSizeGLScene(width, height); // Set Up Our Perspective GL Screen 71 71 72 if (!InitGL()) 72 if (!InitGL()) // Initialize Our Newly Created GL Window 73 73 { 74 KillGLWindow();// Reset The Display75 return FALSE; // Return FALSE74 KillGLWindow(); // Reset The Display 75 return FALSE; 76 76 } 77 77 78 return TRUE; // Success78 return TRUE; 79 79 } 80 80 -
orxonox/branches/osX/importer/windowHandler.h
r2804 r2977 14 14 #include <math.h> 15 15 16 #ifdef __WIN32__ 17 #include <windows.h> 18 #endif /* __WIN32__ */ 16 19 17 20 #define TRUE 1 … … 26 29 GLvoid KillGLWindow(GLvoid); 27 30 BOOL CreateGLWindow(char* title, int width, int height, int bits, BOOL fullscreenflag); 31 SDL_Surface* screen; 28 32 private: 29 33 int InitGL(GLvoid); -
orxonox/branches/osX/src/object.cc
r2866 r2977 297 297 } 298 298 objFileName = fileName; 299 char Buffer[ 500];299 char Buffer[10000]; 300 300 while(!OBJ_FILE->eof()) 301 301 { 302 OBJ_FILE->getline(Buffer, 500);302 OBJ_FILE->getline(Buffer, 10000); 303 303 if (verbose >=4) 304 304 printf ("Read input line: %s\n",Buffer); … … 379 379 { 380 380 currentGroup->vertices->finalizeArray(); 381 glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());381 // glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray()); 382 382 currentGroup->normals->finalizeArray(); 383 glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());383 // glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray()); 384 384 currentGroup->vTexture->finalizeArray(); 385 385 } … … 387 387 readingVertices = false; 388 388 currentGroup->faceCount++; 389 char subbuffer1[20]; 390 char subbuffer2[20]; 391 char subbuffer3[20]; 392 char subbuffer4[20] =""; 393 sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 394 if (!strcmp(subbuffer4, "")) 389 390 int elemCount = 0; 391 392 FaceElement* firstElem = new FaceElement; 393 FaceElement* tmpElem = firstElem; 394 395 396 while(strcmp (faceString, "\0")) 397 { 398 if (elemCount>0) 399 tmpElem = tmpElem->next = new FaceElement; 400 tmpElem->next = NULL; 401 402 403 sscanf (faceString, "%s", tmpElem->value); 404 faceString += strlen(tmpElem->value); 405 if (strcmp (faceString, "\0")) 406 faceString++; 407 elemCount++; 408 409 410 } 411 412 413 if (elemCount == 3) 395 414 { 396 415 if (currentGroup->faceMode != 3) … … 403 422 currentGroup->faceMode = 3; 404 423 if (verbose >=3) 405 printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3); 406 addGLElement(subbuffer1); 407 addGLElement(subbuffer2); 408 addGLElement(subbuffer3); 409 return true; 410 } 411 else 424 printf ("found triag.\n"); 425 } 426 427 else if (elemCount == 4) 412 428 { 413 429 if (currentGroup->faceMode != 4) … … 419 435 currentGroup->faceMode = 4; 420 436 if (verbose >=3 ) 421 printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4); 422 addGLElement(subbuffer1); 423 addGLElement(subbuffer2); 424 addGLElement(subbuffer3); 425 addGLElement(subbuffer4); 426 return true; 427 } 437 printf ("found quad.\n"); 438 } 439 440 else if (elemCount > 4) 441 { 442 if (currentGroup->faceMode != -1) 443 glEnd(); 444 glBegin(GL_POLYGON); 445 if (verbose >=3) 446 printf ("Polygon with %i faces found.", elemCount); 447 currentGroup->faceMode = elemCount; 448 } 449 450 tmpElem = firstElem; 451 while (tmpElem != NULL) 452 { 453 // printf ("%s\n", tmpElem->value); 454 addGLElement(tmpElem->value); 455 tmpElem = tmpElem->next; 456 } 457 428 458 } 429 459 … … 444 474 445 475 char* texture; 446 texture = strstr (vertex, "/"); 447 texture[0] = '\0'; 448 texture ++; 449 if (verbose>=3) 450 printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount()); 451 glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2); 452 453 char* normal; 454 if ((normal = strstr (texture, "/")) !=NULL) 455 { 456 normal[0] = '\0'; 457 normal ++; 458 //glArrayElement(atoi(vertex)-1); 459 glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3); 476 if ((texture = strstr (vertex, "/")) != NULL) 477 { 478 texture[0] = '\0'; 479 texture ++; 480 if (verbose>=3) 481 printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount()); 482 glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2); 483 484 char* normal; 485 if ((normal = strstr (texture, "/")) !=NULL) 486 { 487 normal[0] = '\0'; 488 normal ++; 489 //glArrayElement(atoi(vertex)-1); 490 glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3); 491 } 460 492 } 461 493 if (verbose>=3) -
orxonox/branches/osX/src/object.h
r2866 r2977 18 18 extern int verbose; //!< fill be removed and added again as a verbose-class 19 19 20 21 struct FaceElement 22 { 23 char value[20]; 24 FaceElement* next; 25 }; 20 26 21 27 //! Class that handles 3D-Objects. it can also read them in and display them. -
orxonox/branches/osX/src/player.cc
r2816 r2977 26 26 { 27 27 28 obj = new Object ("reap high.obj");28 obj = new Object ("reaplow.obj"); 29 29 /* 30 30 objectList = glGenLists(1);
Note: See TracChangeset
for help on using the changeset viewer.