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:
Le Philousophe 2022-01-24 15:52:14 +01:00
parent 41638a09d1
commit 7061b4109e
4 changed files with 5 additions and 16 deletions

View file

@ -22,7 +22,7 @@
#include "common/textconsole.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"
@ -124,7 +124,7 @@ void FrameBuffer::detach() {
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)
: FrameBuffer(width,height) {
if (!OpenGLContext.framebufferObjectMultisampleSupported) {
@ -186,7 +186,7 @@ void MultiSampleFrameBuffer::detach() {
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

View file

@ -34,17 +34,10 @@ class FrameBuffer : public TextureGL {
public:
FrameBuffer(uint width, uint 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 void attach();
virtual void detach();
#endif
protected:
GLuint getFrameBufferName() const { return _frameBuffer; }
@ -56,7 +49,7 @@ private:
GLint _prevStateViewport[4];
};
#if !USE_FORCED_GLES2 && !defined(AMIGAOS) && !defined(__MORPHOS__)
#if !USE_FORCED_GLES2
class MultiSampleFrameBuffer : public FrameBuffer {
public:
MultiSampleFrameBuffer(uint width, uint height, int samples);

View file

@ -356,13 +356,11 @@ void OpenGLSdlGraphics3dManager::createOrUpdateScreen() {
_screenChangeCount++;
#if !defined(__amigaos4__) && !defined(__MORPHOS__)
if (renderToFrameBuffer) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
_frameBuffer = createFramebuffer(_engineRequestedWidth, _engineRequestedHeight);
_frameBuffer->attach();
}
#endif
}
Math::Rect2d OpenGLSdlGraphics3dManager::computeGameRect(bool renderToFrameBuffer, uint gameWidth, uint gameHeight,
@ -579,7 +577,6 @@ void OpenGLSdlGraphics3dManager::drawOverlay() {
_surfaceRenderer->restorePreviousState();
}
#if !defined(__amigaos4__) && !defined(__MORPHOS__)
OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, uint height) {
#if !USE_FORCED_GLES2
if (_antialiasing && OpenGLContext.framebufferObjectMultisampleSupported) {
@ -590,7 +587,6 @@ OpenGL::FrameBuffer *OpenGLSdlGraphics3dManager::createFramebuffer(uint width, u
return new OpenGL::FrameBuffer(width, height);
}
}
#endif
void OpenGLSdlGraphics3dManager::updateScreen() {
if (_frameBuffer) {

View file

@ -328,7 +328,7 @@ void OSystem_SDL::detectOpenGLFeaturesSupport() {
_oglType = OpenGL::kOGLContextGLES2;
_supportsFrameBuffer = 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
#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);