many changes

* Fixes in WIN32 platform
* Remove unused files
* Make StaticText work more like tibia
* Fix WIN32 compilation
* Fix regression in framebuffers that caused battle to disappear
* Shader fixes for DX9
* Add two new shaders: noise and heat
This commit is contained in:
Eduardo Bart
2012-06-15 19:18:30 -03:00
parent 10b60a3871
commit 4813b7eb4b
19 changed files with 203 additions and 177 deletions

View File

@@ -205,6 +205,7 @@ void WIN32Window::init()
internalCreateWindow();
internalCreateGLContext();
internalRestoreGLContext();
}
void WIN32Window::terminate()
@@ -253,7 +254,7 @@ void WIN32Window::internalCreateWindow()
wc.hInstance = m_instance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = m_defaultCursor;
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_app->getName().c_str();
@@ -344,8 +345,6 @@ void WIN32Window::internalCreateGLContext()
if(m_eglContext == EGL_NO_CONTEXT )
g_logger.fatal(stdext::format("Unable to create EGL context: %s", eglGetError()));
if(!eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext))
g_logger.fatal("Unable to make current EGL context");
#else
uint pixelFormat;
static PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR),
@@ -374,9 +373,6 @@ void WIN32Window::internalCreateGLContext()
if(!(m_wglContext = wglCreateContext(m_deviceContext)))
g_logger.fatal("Unable to create GL context");
if(!wglMakeCurrent(m_deviceContext, m_wglContext))
g_logger.fatal("Unable to set GLX context on WIN32 window");
#endif
}
@@ -406,6 +402,17 @@ void WIN32Window::internalDestroyGLContext()
#endif
}
void WIN32Window::internalRestoreGLContext()
{
#ifdef OPENGL_ES
if(!eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext))
g_logger.fatal("Unable to make current EGL context");
#else
if(!wglMakeCurrent(m_deviceContext, m_wglContext))
g_logger.fatal("Unable to make current WGL context");
#endif
}
bool WIN32Window::isExtensionSupported(const char *ext)
{
#ifdef OPENGL_ES
@@ -707,6 +714,9 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
}
if(m_visible && m_deviceContext)
internalRestoreGLContext();
Size size;
size.setWidth(std::max(std::min((int)LOWORD(lParam), 7680), m_minimumSize.width()));
size.setHeight(std::max(std::min((int)HIWORD(lParam), 4320), m_minimumSize.height()));

View File

@@ -38,6 +38,7 @@ class WIN32Window : public PlatformWindow
void internalCreateWindow();
void internalCreateGLContext();
void internalDestroyGLContext();
void internalRestoreGLContext();
void *getExtensionProcAddress(const char *ext);
bool isExtensionSupported(const char *ext);