fix particles only rendering in one editor viewport by always enabling VBA&VBO workaround in editor mode (#1195)

The problem was caused by every window using an own OpenGL context and certain objects not being shared between those.
The best solution would still be to make all windows use ONE OpenGL context. But this would probably need a more or less large rewrite?

This solution has to be considered a workaround with basically no negative side-effects, as the loss of speed is most likely irrelevant in editor mode.
stable-6.1
David Dormagen 2015-03-22 09:52:34 +01:00 committed by Maikel de Vries
parent fca649707a
commit a9f4ee88d3
1 changed files with 8 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#ifndef USE_CONSOLE
// headers for particle excution
#include <C4Application.h>
#include <C4AulDefFunc.h>
#include <C4Value.h>
#include <C4ValueArray.h>
@ -30,7 +31,7 @@
#include <C4DrawGL.h>
#include <C4Random.h>
#include <C4Landscape.h>
#include <C4Weather.h>
#include <C4Weather.h>
#endif
@ -1290,6 +1291,12 @@ void C4ParticleSystem::DoInit()
assert (glGenBuffers != 0 && "Your graphics card does not seem to support buffer objects.");
useBufferObjectWorkaround = false;
// Every window in developers' mode has an own OpenGL context at the moment. Certain objects are not shared between contexts.
// In that case we can just use the slower workaround without VBAs and VBOs to allow the developer to view particles in every viewport.
// The best solution would obviously be to make all windows use a single OpenGL context. This has to be considered as a workaround.
if (Application.isEditor)
useBufferObjectWorkaround = true;
}
void C4ParticleSystem::ExecuteCalculation()