← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/opengl_debug into lp:widelands

 

Adresed all comments and copied an explanative text into initialize.cc



Diff comments:

> 
> === added file 'src/graphic/gl/initialize.h'
> --- src/graphic/gl/initialize.h	1970-01-01 00:00:00 +0000
> +++ src/graphic/gl/initialize.h	2016-01-24 12:46:35 +0000
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2006-2016 by the Widelands Development Team
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + */
> +
> +#ifndef WL_GRAPHIC_GL_INITIALIZE_H
> +#define WL_GRAPHIC_GL_INITIALIZE_H
> +
> +#include <SDL.h>
> +
> +#include "graphic/gl/system_headers.h"
> +
> +namespace Gl {
> +
> +// Initializes OpenGL. Creates a context for 'window' using SDL and loads the
> +// GL library. Fills in 'max_texture_size' and returns the created SDL_Context
> +// which must be closed by the caller.
> +// If we are build against glbinding, 'trace' will set up tracing for

done.

> +// OpenGL and output every single opengl call ever made, together with it's
> +// arguments, return values and the result from glGetError.
> +enum class Trace {
> +	kYes,
> +	kNo,
> +};
> +SDL_GLContext
> +initialize(const Trace& trace, SDL_Window* window, GLint* max_texture_size);
> +
> +}  // namespace Gl
> +
> +#endif  // end of include guard: WL_GRAPHIC_GL_INITIALIZE_H
> 
> === modified file 'src/graphic/texture.cc'
> --- src/graphic/texture.cc	2016-01-13 07:27:55 +0000
> +++ src/graphic/texture.cc	2016-01-24 12:46:35 +0000
> @@ -187,7 +188,7 @@
>  		w, h,
>  		Rect(0, 0, w, h),
>  	};
> -	if (width() <= 0 || height() <= 0) {
> +	if (w * h == 0) {

at this point texture_id is always = 0. It is only initialized a few lines further down, so this is the gate keeper if it should be set to != 0.

>  		return;
>  	}
>  


-- 
https://code.launchpad.net/~widelands-dev/widelands/opengl_debug/+merge/283738
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/opengl_debug into lp:widelands.


References