clean up my messes in the windows build

This commit is contained in:
zeromus 2008-09-14 16:27:40 +00:00
parent ec3b477616
commit c56a1996f9
2 changed files with 12 additions and 52 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Version="9.00"
Name="DeSmuME_VS2008"
ProjectGUID="{9F5F72A1-D3A5-4918-B460-E076B16D10A9}"
RootNamespace="DeSmuME"
@ -783,6 +783,10 @@
RelativePath=".\oamView.cpp"
>
</File>
<File
RelativePath=".\ogl.cpp"
>
</File>
<File
RelativePath="..\OGLRender.cpp"
>

View File

@ -60,8 +60,6 @@
#include "snddx.h"
#include <ddraw.h>
#include <GL/gl.h>
#include <GL/glext.h>
#define GPU3D_NULL 0
#define GPU3D_OPENGL 1
@ -428,7 +426,9 @@ DWORD WINAPI run( LPVOID lpParameter)
return -1;
}
if (!oglrender_init())
NDS_3D_SetDriver (GPU3D_OPENGL);
if (!gpu3D->NDS_3D_Init ())
{
MessageBox(hwnd,"Unable to initialize openGL","Error",MB_OK);
return -1;
@ -753,48 +753,6 @@ void InitCustomControls()
ColorCtrl_Register();
}
bool windows_opengl_init()
{
HDC oglDC = NULL;
HGLRC hRC = NULL;
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd;
oglDC = GetDC (hwnd);
memset(&pfd,0, sizeof(PIXELFORMATDESCRIPTOR));
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 24;
pfd.cAlphaBits = 8;
pfd.cStencilBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE ;
pixelFormat = ChoosePixelFormat(oglDC, &pfd);
if (pixelFormat == 0) return false;
if(!SetPixelFormat(oglDC, pixelFormat, &pfd)) return false;
hRC = wglCreateContext(oglDC);
if (!hRC) return false;
if(!wglMakeCurrent(oglDC, hRC)) return false;
return true;
}
bool windows_opengl_begin()
{
return false;
}
void windows_opengl_end()
{
}
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
@ -811,10 +769,8 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
#endif
struct configured_features my_config;
//extern bool windows_opengl_init();
extern bool windows_opengl_init();
oglrender_init = windows_opengl_init;
oglrender_beginOpenGL = windows_opengl_begin;
oglrender_endOpenGL = windows_opengl_end;
MSG messages; /* Here messages to the application are saved */
@ -987,7 +943,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
runthread = CreateThread(NULL, 0, run, NULL, 0, &threadID);
//wait for the run thread to signal that it is initialized and ready to run
//WaitForSingleObject(runthread_ready,INFINITE);
WaitForSingleObject(runthread_ready,INFINITE);
// Make sure any quotes from lpszArgument are removed
@ -1131,8 +1087,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (ForceRatio) {
RECT fullSize;
GetWindowRect(hwnd, &fullSize);
//ScaleScreen(windowSize); // why? this is broke free resize
ScaleScreen((fullSize.bottom - fullSize.top - heightTradeOff) / DefaultHeight);
ScaleScreen(windowSize);
//ScaleScreen((fullSize.bottom - fullSize.top - heightTradeOff) / DefaultHeight);
}
GetRect(hwnd);
return 0;