[Video] Remove g_hwnd_win

This commit is contained in:
zilmar 2017-08-18 08:08:43 +10:00
parent b479eb056d
commit bddf192160
3 changed files with 12 additions and 30 deletions

View File

@ -87,7 +87,6 @@ bool g_capture_screen = false;
std::string g_capture_path;
#ifdef _WIN32
HWND g_hwnd_win = NULL;
static RECT g_windowedRect = { 0 };
static HMENU g_windowedMenu = 0;
static unsigned long g_windowedExStyle, g_windowedStyle;
@ -363,12 +362,6 @@ void DisplayLoadProgress(const wchar_t *format, ...)
#ifdef _WIN32
void SetWindowDisplaySize(HWND hWnd)
{
if (hWnd == NULL)
{
hWnd = GetActiveWindow();
}
g_hwnd_win = (HWND)hWnd;
if (ev_fullscreen)
{
ZeroMemory(&g_windowedRect, sizeof(RECT));
@ -429,10 +422,10 @@ void ExitFullScreen(void)
if (g_fullscreen)
{
ChangeDisplaySettings(NULL, 0);
SetWindowPos(g_hwnd_win, NULL, g_windowedRect.left, g_windowedRect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
SetWindowLong(g_hwnd_win, GWL_STYLE, g_windowedStyle);
SetWindowLong(g_hwnd_win, GWL_EXSTYLE, g_windowedExStyle);
if (g_windowedMenu) SetMenu(g_hwnd_win, g_windowedMenu);
SetWindowPos((HWND)gfx.hWnd, NULL, g_windowedRect.left, g_windowedRect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
SetWindowLong((HWND)gfx.hWnd, GWL_STYLE, g_windowedStyle);
SetWindowLong((HWND)gfx.hWnd, GWL_EXSTYLE, g_windowedExStyle);
if (g_windowedMenu) SetMenu((HWND)gfx.hWnd, g_windowedMenu);
g_fullscreen = false;
}
}

View File

@ -183,8 +183,6 @@ static int texbuf_i;
unsigned short frameBuffer[2048 * 2048 * 2]; // Support 2048x2048 screen resolution at 32 bits (RGBA) per pixel
unsigned short depthBuffer[2048 * 2048]; // Support 2048x2048 screen resolution at 16 bits (depth) per pixel
//#define VOODOO1
void display_warning(const char *text, ...)
{
static int first_message = 100;

View File

@ -12,6 +12,7 @@
* *
****************************************************************************/
#include <Project64-video/Renderer/Renderer.h>
#include <Project64-video/Gfx_1.3.h>
#define SAVE_CBUFFER
@ -328,8 +329,6 @@ static int texbuf_i;
unsigned short frameBuffer[2048 * 2048];
unsigned short depthBuffer[2048 * 2048];
//#define VOODOO1
void gfxClipWindow(uint32_t minx, uint32_t miny, uint32_t maxx, uint32_t maxy)
{
WriteTrace(TraceGlitch, TraceDebug, "minx = %d, miny: %d maxy: %d", minx, miny, maxy);
@ -441,14 +440,6 @@ int isWglExtensionSupported(const char *extension)
#define GrPixelFormat_t int
#ifdef _WIN32
# include <fcntl.h>
# ifndef ATTACH_PARENT_PROCESS
# define ATTACH_PARENT_PROCESS ((uint32_t)-1)
# endif
extern HWND g_hwnd_win;
#endif
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
{
static int show_warning = 1;
@ -487,7 +478,11 @@ bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_loc
screen_width = g_width;
screen_height = g_height;
if ((hDC = GetDC(g_hwnd_win)) == NULL)
if ((HWND)gfx.hWnd != NULL)
{
hDC = GetDC((HWND)gfx.hWnd);
}
if (hDC == NULL)
{
WriteTrace(TraceGlitch, TraceWarning, "GetDC on main window failed");
return false;
@ -562,10 +557,6 @@ bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_loc
if (nbAuxBuffers > 0)
printf("Congratulations, you have %d auxilliary buffers, we'll use them wisely !\n", nbAuxBuffers);
#ifdef VOODOO1
nbTextureUnits = 2;
#endif
if (isExtensionSupported("GL_EXT_blend_func_separate") == 0)
blend_func_separate_support = 0;
else
@ -834,7 +825,7 @@ bool gfxSstWinClose()
glDeleteFramebuffersEXT(1, &(fbs[i].fbid));
glDeleteRenderbuffersEXT(1, &(fbs[i].zbid));
}
}
}
#endif
nb_fb = 0;
@ -1815,7 +1806,7 @@ void gfxGetGammaTableExt(uint32_t /*nentries*/, uint32_t *red, uint32_t *green,
blue[i] = aGammaRamp[2][i] >> 8;
}
}
}
}
void gfxGammaCorrectionRGB(float gammaR, float gammaG, float gammaB)
{