Incremental fix on my Navigator work - switched out global to JGE vars actualWidth/Height to be real accessible members of the JRenderer instance, so that we can actually access what the real display width is from within the MTG project. This makes the fix for enchantment zone targetting work when the window is resized on Win32.
This commit is contained in:
+3
-5
@@ -11,8 +11,6 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable : 4786)
|
||||
extern int actualWidth;
|
||||
extern int actualHeight;
|
||||
#pragma comment( lib, "giflib.lib" )
|
||||
#endif
|
||||
|
||||
@@ -393,7 +391,7 @@ void JRenderer::Destroy()
|
||||
}
|
||||
}
|
||||
|
||||
JRenderer::JRenderer()
|
||||
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -814,8 +812,8 @@ void JRenderer::BeginScene()
|
||||
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
|
||||
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||
#ifdef WIN32
|
||||
float scaleH = (float)actualHeight/SCREEN_HEIGHT_F;
|
||||
float scaleW = (float)actualWidth/SCREEN_WIDTH_F;
|
||||
float scaleH = mActualHeight/SCREEN_HEIGHT_F;
|
||||
float scaleW = mActualWidth/SCREEN_WIDTH_F;
|
||||
glScalef(scaleW,scaleW,1.f);
|
||||
#endif
|
||||
checkGlError();
|
||||
|
||||
+4
-7
@@ -10,9 +10,6 @@
|
||||
* Visit My Site At nehe.gamedev.net
|
||||
*/
|
||||
|
||||
int actualWidth;
|
||||
int actualHeight;
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h> // Header File For Windows
|
||||
#else
|
||||
@@ -199,8 +196,8 @@ GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize Th
|
||||
if (height==0) // Prevent A Divide By Zero By
|
||||
height=1; // Making Height Equal One
|
||||
|
||||
actualWidth = width;
|
||||
actualHeight = height;
|
||||
JRenderer::GetInstance()->SetActualWidth(static_cast<float>(width));
|
||||
JRenderer::GetInstance()->SetActualHeight(static_cast<float>(height));
|
||||
|
||||
glScissor(0, 0, width, height);
|
||||
glViewport (0, 0, width, height); // Reset The Current Viewport
|
||||
@@ -353,8 +350,8 @@ void KillGLWindow(void) // Properly Kill The Window
|
||||
BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
|
||||
{
|
||||
|
||||
actualWidth = width;
|
||||
actualHeight = height;
|
||||
JRenderer::GetInstance()->SetActualWidth(static_cast<float>(width));
|
||||
JRenderer::GetInstance()->SetActualWidth(static_cast<float>(height));
|
||||
|
||||
|
||||
GLuint pixelFormat; // Holds The Results After Searching For A Match
|
||||
|
||||
Reference in New Issue
Block a user