diff --git a/src/cocoa/i_backend_cocoa.mm b/src/cocoa/i_backend_cocoa.mm index ff602cb9db..873b34c032 100644 --- a/src/cocoa/i_backend_cocoa.mm +++ b/src/cocoa/i_backend_cocoa.mm @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -1214,16 +1215,16 @@ static ApplicationController* appCtrl; { if (0 == m_softwareRenderingTexture) { - glEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_RECTANGLE_ARB); glGenTextures(1, &m_softwareRenderingTexture); - glBindTexture(GL_TEXTURE_2D, m_softwareRenderingTexture); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_softwareRenderingTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } delete[] m_softwareRenderingBuffer; @@ -1750,18 +1751,18 @@ int SDL_Flip(SDL_Surface* screen) const int width = screen->w; const int height = screen->h; - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, screen->pixels); glBegin(GL_QUADS); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 0.0f); - glTexCoord2f(1.0f, 0.0f); + glTexCoord2f(width, 0.0f); glVertex2f(width, 0.0f); - glTexCoord2f(1.0f, 1.0f); + glTexCoord2f(width, height); glVertex2f(width, height); - glTexCoord2f(0.0f, 1.0f); + glTexCoord2f(0.0f, height); glVertex2f(0.0f, height); glEnd();