Merge lp:~widelands-dev/widelands/win32_glew into lp:widelands

Proposed by Tino
Status: Merged
Merged at revision: 5855
Proposed branch: lp:~widelands-dev/widelands/win32_glew
Merge into: lp:widelands
Diff against target: 119 lines (+64/-0)
5 files modified
CMakeLists.txt (+7/-0)
cmake/Modules/FindGLEW.cmake (+47/-0)
src/CMakeLists.txt (+2/-0)
src/graphic/render/gl_picture_texture.h (+4/-0)
src/graphic/render/gl_utils.h (+4/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/win32_glew
Reviewer Review Type Date Requested Status
Nicolai Hähnle Approve
Review via email: mp+50529@code.launchpad.net

Description of the change

The latest OpenGL related changes to Widelands do require OpenGL >=1.4.

Windows only provides 1.1 (1.2?), so we do have to use GLEW: http://glew.sourceforge.net/

I've tried to break nothing for other platforms, please test this branch...

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

I have no time to review this right now, but this should definitivly go into build 16. I suggest merging right away and wait for the cries of others.

Revision history for this message
Nicolai Hähnle (nha) wrote :

It looks good to me, /but/ I think it should not be WIN32 specific. I will test this tonight without the if (WIN32) stuff, and if it works fine for me I will merge (unless there are other comments until then).

Revision history for this message
Nicolai Hähnle (nha) wrote :

Merged. I changed things around a little so that GLEW is also used on Linux - after all, we'll probably need it there as well eventually.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2010-12-20 21:14:01 +0000
+++ CMakeLists.txt 2011-02-20 21:01:46 +0000
@@ -266,6 +266,13 @@
266if (OPENGL_FOUND)266if (OPENGL_FOUND)
267 # OpenGL Headers are not needed directly. Instead SDL_opengl.h should be searched267 # OpenGL Headers are not needed directly. Instead SDL_opengl.h should be searched
268 add_definitions("-DUSE_OPENGL")268 add_definitions("-DUSE_OPENGL")
269 if (WIN32)
270 find_package(GLEW)
271 if (GLEW_FOUND)
272 else (GLEW FOUND)
273 message (STATUS "GLEW library not found, check your libraries path and installed packages!")
274 endif (GLEW_FOUND)
275 endif (WIN32)
269else (OPENGL_FOUND)276else (OPENGL_FOUND)
270 message (STATUS "OpenGL support disabled, check your libraries path and installed packages!")277 message (STATUS "OpenGL support disabled, check your libraries path and installed packages!")
271endif (OPENGL_FOUND)278endif (OPENGL_FOUND)
272279
=== added file 'cmake/Modules/FindGLEW.cmake'
--- cmake/Modules/FindGLEW.cmake 1970-01-01 00:00:00 +0000
+++ cmake/Modules/FindGLEW.cmake 2011-02-20 21:01:46 +0000
@@ -0,0 +1,47 @@
1# - Try to find GLEW
2# Once done this will define
3#
4# GLEW_FOUND - system has GLEW
5# GLEW_INCLUDE_DIR - the GLEW include directory
6# GLEW_LIBRARY_DIR - where the libraries are
7# GLEW_LIBRARY - Link these to use GLEW
8#
9
10IF (GLEW_INCLUDE_DIR)
11 # Already in cache, be silent
12 SET(GLEW_FIND_QUIETLY TRUE)
13ENDIF (GLEW_INCLUDE_DIR)
14
15if( WIN32 )
16 if( MSVC80 )
17 set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC" )
18 endif( MSVC80 )
19 if( MSVC71 )
20 set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ .NET\ 2003/Vc7" )
21 endif( MSVC71 )
22 FIND_PATH( GLEW_INCLUDE_DIR gl/glew.h gl/wglew.h
23 PATHS c:/glew/include ${COMPILER_PATH}/PlatformSDK/Include )
24 SET( GLEW_NAMES glew32 )
25 FIND_LIBRARY( GLEW_LIBRARY
26 NAMES ${GLEW_NAMES}
27 PATHS c:/glew/lib ${COMPILER_PATH}/PlatformSDK/Lib )
28else( WIN32 )
29 FIND_PATH( GLEW_INCLUDE_DIR glew.h wglew.h
30 PATHS /usr/local/include /usr/include
31 PATH_SUFFIXES gl/ GL/ )
32 SET( GLEW_NAMES glew GLEW )
33 FIND_LIBRARY( GLEW_LIBRARY
34 NAMES ${GLEW_NAMES}
35 PATHS /usr/lib /usr/local/lib )
36endif( WIN32 )
37
38GET_FILENAME_COMPONENT( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} PATH )
39
40IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
41 SET(GLEW_FOUND TRUE)
42 SET( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} )
43ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
44 SET( GLEW_FOUND FALSE )
45 SET( GLEW_LIBRARY_DIR )
46ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
47
048
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2011-02-10 20:41:30 +0000
+++ src/CMakeLists.txt 2011-02-20 21:01:46 +0000
@@ -114,6 +114,7 @@
114target_link_libraries(widelands_all ${ZLIB_LIBRARY})114target_link_libraries(widelands_all ${ZLIB_LIBRARY})
115target_link_libraries(widelands_all ${GGZ_CORE_LIBRARY})115target_link_libraries(widelands_all ${GGZ_CORE_LIBRARY})
116target_link_libraries(widelands_all ${OPENGL_gl_LIBRARY})116target_link_libraries(widelands_all ${OPENGL_gl_LIBRARY})
117
117if (DEFINED WL_EXTRA_LINK_LIBRARIES)118if (DEFINED WL_EXTRA_LINK_LIBRARIES)
118 target_link_libraries(widelands_all ${WL_EXTRA_LINK_LIBRARIES})119 target_link_libraries(widelands_all ${WL_EXTRA_LINK_LIBRARIES})
119endif (DEFINED WL_EXTRA_LINK_LIBRARIES)120endif (DEFINED WL_EXTRA_LINK_LIBRARIES)
@@ -138,6 +139,7 @@
138 else (DEFINED MSVC)139 else (DEFINED MSVC)
139 target_link_libraries(widelands_all wsock32)140 target_link_libraries(widelands_all wsock32)
140 endif (DEFINED MSVC)141 endif (DEFINED MSVC)
142 target_link_libraries(widelands_all ${GLEW_LIBRARY})
141endif (WIN32)143endif (WIN32)
142144
143install(TARGETS widelands DESTINATION ${WL_INSTALL_BINDIR} COMPONENT ExecutableFiles)145install(TARGETS widelands DESTINATION ${WL_INSTALL_BINDIR} COMPONENT ExecutableFiles)
144146
=== modified file 'src/graphic/render/gl_picture_texture.h'
--- src/graphic/render/gl_picture_texture.h 2010-11-27 16:23:39 +0000
+++ src/graphic/render/gl_picture_texture.h 2011-02-20 21:01:46 +0000
@@ -21,6 +21,10 @@
2121
22#include <boost/scoped_array.hpp>22#include <boost/scoped_array.hpp>
2323
24#ifdef WIN32
25#define NO_SDL_GLEXT
26#include <GL/glew.h>
27#endif
24#include <SDL_opengl.h>28#include <SDL_opengl.h>
2529
26#include "graphic/picture.h"30#include "graphic/picture.h"
2731
=== modified file 'src/graphic/render/gl_utils.h'
--- src/graphic/render/gl_utils.h 2010-11-27 16:23:39 +0000
+++ src/graphic/render/gl_utils.h 2011-02-20 21:01:46 +0000
@@ -20,6 +20,10 @@
20#define GL_UTILS_H20#define GL_UTILS_H
2121
22#include <stdint.h>22#include <stdint.h>
23#ifdef WIN32
24#define NO_SDL_GLEXT
25#include <GL/glew.h>
26#endif
23#include <SDL_opengl.h>27#include <SDL_opengl.h>
2428
25struct SDL_PixelFormat;29struct SDL_PixelFormat;

Subscribers

People subscribed via source and target branches

to status/vote changes: