AMIGAOS: Remove outdated ifdefs
We now link with OpenGL dynamically so symbols are provided by GLAD. If it's not supported pointer will be null. OGLES2 should support these functions so they must be removed
This commit is contained in:
parent
41638a09d1
commit
7061b4109e
4 changed files with 5 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
#if (defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)) && !defined(AMIGAOS) && !defined(__MORPHOS__)
|
#if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
|
||||||
|
|
||||||
#include "backends/graphics3d/opengl/framebuffer.h"
|
#include "backends/graphics3d/opengl/framebuffer.h"
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void FrameBuffer::detach() {
|
||||||
glViewport(_prevStateViewport[0], _prevStateViewport[1], _prevStateViewport[2], _prevStateViewport[3]);
|
glViewport(_prevStateViewport[0], _prevStateViewport[1], _prevStateViewport[2], _prevStateViewport[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !USE_FORCED_GLES2 && !defined(AMIGAOS) && !defined(__MORPHOS__)
|
#if !USE_FORCED_GLES2
|
||||||
MultiSampleFrameBuffer::MultiSampleFrameBuffer(uint width, uint height, int samples)
|
MultiSampleFrameBuffer::MultiSampleFrameBuffer(uint width, uint height, int samples)
|
||||||
: FrameBuffer(width,height) {
|
: FrameBuffer(width,height) {
|
||||||
if (!OpenGLContext.framebufferObjectMultisampleSupported) {
|
if (!OpenGLContext.framebufferObjectMultisampleSupported) {
|
||||||
|
@ -186,7 +186,7 @@ void MultiSampleFrameBuffer::detach() {
|
||||||
glViewport(_prevStateViewport[0], _prevStateViewport[1], _prevStateViewport[2], _prevStateViewport[3]);
|
glViewport(_prevStateViewport[0], _prevStateViewport[1], _prevStateViewport[2], _prevStateViewport[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !USE_FORCED_GLES2 && !defined(AMIGAOS) && !defined(__MORPHOS__)
|
#endif // !USE_FORCED_GLES2
|
||||||
|
|
||||||
} // End of namespace OpenGL
|
} // End of namespace OpenGL
|
||||||
|
|
||||||
|
|
|
@ -34,17 +34,10 @@ class FrameBuffer : public TextureGL {
|
||||||
public:
|
public:
|
||||||
FrameBuffer(uint width, uint height);
|
FrameBuffer(uint width, uint height);
|
||||||
FrameBuffer(GLuint texture_name, uint width, uint height, uint texture_width, uint texture_height);
|
FrameBuffer(GLuint texture_name, uint width, uint height, uint texture_width, uint texture_height);
|
||||||
#if defined(AMIGAOS) || defined(__MORPHOS__)
|
|
||||||
virtual ~FrameBuffer() {}
|
|
||||||
|
|
||||||
void attach() {}
|
|
||||||
void detach() {}
|
|
||||||
#else
|
|
||||||
virtual ~FrameBuffer();
|
virtual ~FrameBuffer();
|
||||||
|
|
||||||
virtual void attach();
|
virtual void attach();
|
||||||
virtual void detach();
|
virtual void detach();
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GLuint getFrameBufferName() const { return _frameBuffer; }
|
GLuint getFrameBufferName() const { return _frameBuffer; }
|
||||||
|
@ -56,7 +49,7 @@ private:
|
||||||
GLint _prevStateViewport[4];
|
GLint _prevStateViewport[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !USE_FORCED_GLES2 && !defined(AMIGAOS) && !defined(__MORPHOS__)
|
#if !USE_FORCED_GLES2
|
||||||
class MultiSampleFrameBuffer : public FrameBuffer {
|
class MultiSampleFrameBuffer : public FrameBuffer {
|
||||||
public:
|
public:
|
||||||
MultiSampleFrameBuffer(uint width, uint height, int samples);
|
MultiSampleFrameBuffer(uint width, uint height, int samples);
|
||||||
|
|
|
@ -356,13 +356,11 @@ void OpenGLSdlGraphics3dManager::createOrUpdateScreen() {
|
||||||
|
|
||||||
_screenChangeCount++;
|
_screenChangeCount++;
|
||||||
|
|
||||||
#if !defined(__amigaos4__) && !defined(__MORPHOS__)
|
|
||||||
if (renderToFrameBuffer) {
|
if (renderToFrameBuffer) {
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
_frameBuffer = createFramebuffer(_engineRequestedWidth, _engineRequestedHeight);
|
_frameBuffer = createFramebuffer(_engineRequestedWidth, _engineRequestedHeight);
|
||||||
_frameBuffer->attach();
|
_frameBuffer->attach();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Math::Rect2d OpenGLSdlGraphics3dManager::computeGameRect(bool renderToFrameBuffer, uint gameWidth, uint gameHeight,
|
Math::Rect2d OpenGLSdlGraphics3dManager::computeGameRect(bool renderToFrameBuffer, uint gameWidth, uint gameHeight,
|
||||||
|
@ -579,7 +577,6 @@ void OpenGLSdlGraphics3dManager::drawOverlay() {
|
||||||
_surfaceRenderer->restorePreviousState();
|
_surfaceRenderer->restorePreviousState();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__amigaos4__) && !defined(__MORPHOS__)
|
|
||||||
OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, uint height) {
|
OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, uint height) {
|
||||||
#if !USE_FORCED_GLES2
|
#if !USE_FORCED_GLES2
|
||||||
if (_antialiasing && OpenGLContext.framebufferObjectMultisampleSupported) {
|
if (_antialiasing && OpenGLContext.framebufferObjectMultisampleSupported) {
|
||||||
|
@ -590,7 +587,6 @@ OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, u
|
||||||
return new OpenGL::FrameBuffer(width, height);
|
return new OpenGL::FrameBuffer(width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void OpenGLSdlGraphics3dManager::updateScreen() {
|
void OpenGLSdlGraphics3dManager::updateScreen() {
|
||||||
if (_frameBuffer) {
|
if (_frameBuffer) {
|
||||||
|
|
|
@ -328,7 +328,7 @@ void OSystem_SDL::detectOpenGLFeaturesSupport() {
|
||||||
_oglType = OpenGL::kOGLContextGLES2;
|
_oglType = OpenGL::kOGLContextGLES2;
|
||||||
_supportsFrameBuffer = true;
|
_supportsFrameBuffer = true;
|
||||||
_supportsShaders = true;
|
_supportsShaders = true;
|
||||||
#elif !defined(AMIGAOS) && !defined(__MORPHOS__)
|
#else
|
||||||
// Spawn a 32x32 window off-screen with a GL context to test if framebuffers are supported
|
// Spawn a 32x32 window off-screen with a GL context to test if framebuffers are supported
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
SDL_Window *window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 32, 32, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN);
|
SDL_Window *window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 32, 32, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue