widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #05528
Re: [Merge] lp:~widelands-dev/widelands/opengl_debug into lp:widelands
Not compiled or tested yet, but code LGTM - just 2 nits.
I think the option and build requirement should be documented somewhere in the code, because we won't find it in this commit message down the road. I think copying the commit message to src/graphic/gl/initialize.cc should be enough for now.
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
If we are buil*t*
> +// 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) {
The other conditions have:
if (m_blit_data.texture_id == 0) {
Is there a specific reason that there are 2 different conditions?
> 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