Opened 13 years ago

Closed 10 years ago

#741 closed task (fixed)

Reload all GL state when toggling fullscreen on OS X

Reported by: Philip Taylor Owned by:
Priority: Should Have Milestone: Alpha 17
Component: Core engine Keywords: osx
Cc: Patch:

Description

On OS X, switching from fullscreen to windowed mode apparently triggers errors like ogl_program_get_uniform_location(shader, "TextureMatrix1") returning negative values, and the textures disappear and everything goes black and grey and sometimes it crashes.

I guess the GL context state gets lost when toggling fullscreen, in which case we need to destroy and reload all our GL objects (textures, shaders, vertex buffers, framebuffers, etc) when switching.

Change History (7)

comment:1 by historic_bruno, 13 years ago

A similar problem occurs on Windows using SDL 1.2 instead of our custom implementation, see #935. Apparently it has been fixed in SDL 1.3, so that may be an alternative solution.

comment:2 by Philip Taylor, 12 years ago

As far as I'm aware, SDL 1.3 is nowhere near release (and even further from being sufficiently widely available on Linux that we can rely on it as a dependency), so it may not be a viable solution.

comment:3 by ben, 12 years ago

In 11752:

Disables broken window resizing and fullscreen toggling on OS X. Fixes #1381. Refs #741

comment:4 by historic_bruno, 11 years ago

SDL 2.0 fixes resizing and fullscreen toggling on OS X (so far confirmed on 10.8.3, I'll try testing older versions). Even so, it might be nice to have a way to reload all GL state, but it's much less of a priority now.

comment:5 by Markus, 11 years ago

Keywords: osx added

comment:6 by philip, 11 years ago

In 14016:

Refactor text renderer

Replace unifont with CFont and CFontManager, since the h_mgr interface was
needlessly inconvenient.

Load the font textures through CTextureManager, to support dynamic
reloading (e.g. when resetting GL state - see #741).

Add CFontMetrics as a convenient wrapper for code that just wants to
measure text.

Fixes #1117.

comment:7 by historic_bruno, 10 years ago

Milestone: BacklogAlpha 17
Resolution: fixed
Status: newclosed

This will be resolved by the use of SDL2 on OS X, which will be the default for A17.

Note: See TracTickets for help on using tickets.