← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/load_library into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/load_library into lp:widelands.

Commit message:
Explicitly load the GL library, so we might get notified about errors.


Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1536377 in widelands: "The texture atlas must use at least 2048 as size (1024 was given)"
  https://bugs.launchpad.net/widelands/+bug/1536377

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/load_library/+merge/284218

Tries to get more insight into the texture atlas bug.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/load_library into lp:widelands.
=== modified file 'src/graphic/graphic.cc'
--- src/graphic/graphic.cc	2016-01-24 12:43:26 +0000
+++ src/graphic/graphic.cc	2016-01-28 07:01:51 +0000
@@ -78,6 +78,10 @@
 	window_mode_height_ = window_mode_h;
 	requires_update_ = true;
 
+	if (SDL_GL_LoadLibrary(nullptr) == -1) {
+		throw wexception("SDL_GL_LoadLibrary failed: %s", SDL_GetError());
+	}
+
 	log("Graphics: Try to set Videomode %ux%u\n", window_mode_width_, window_mode_height_);
 	sdl_window_ =
 	   SDL_CreateWindow("Widelands Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,

=== modified file 'src/graphic/text/test/render_richtext.cc'
--- src/graphic/text/test/render_richtext.cc	2016-01-24 12:43:26 +0000
+++ src/graphic/text/test/render_richtext.cc	2016-01-28 07:01:51 +0000
@@ -93,8 +93,6 @@
 
 // Setup the static objects Widelands needs to operate and initializes systems.
 void initialize() {
-	SDL_Init(SDL_INIT_VIDEO);
-
 	g_fs = new LayeredFileSystem();
 	g_fs->add_file_system(&FileSystem::create(INSTALL_DATADIR));
 


Follow ups