[Add] Input stuff in Windows.
[Fix] Coordinate system is now correct.
This commit is contained in:
parent
60366c7ad0
commit
931f7d59a0
@ -86,6 +86,7 @@
|
||||
<ClInclude Include="..\..\src\Actor\Player.h" />
|
||||
<ClInclude Include="..\..\src\glx\glext.h" />
|
||||
<ClInclude Include="..\..\src\glx\wglext.h" />
|
||||
<ClInclude Include="..\..\src\IO\Input.h" />
|
||||
<ClInclude Include="..\..\src\Main\Game.h" />
|
||||
<ClInclude Include="..\..\src\Main\GLWindow.h" />
|
||||
<ClInclude Include="..\..\src\Math\FPS.h" />
|
||||
@ -98,6 +99,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\Actor\Player.cpp" />
|
||||
<ClCompile Include="..\..\src\IO\Input.cpp" />
|
||||
<ClCompile Include="..\..\src\Main\Game.cpp" />
|
||||
<ClCompile Include="..\..\src\Main\GLWindow.cpp" />
|
||||
<ClCompile Include="..\..\src\Main\main.cpp" />
|
||||
|
@ -22,6 +22,9 @@
|
||||
<Filter Include="System">
|
||||
<UniqueIdentifier>{1354dd04-f0db-4c12-bbfa-ef24daeb2293}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="IO">
|
||||
<UniqueIdentifier>{5b78104c-8316-4d75-8ad0-3f9a6bfbfde8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\Main\GLWindow.h">
|
||||
@ -60,6 +63,9 @@
|
||||
<ClInclude Include="..\..\src\System\Debug.h">
|
||||
<Filter>System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\IO\Input.h">
|
||||
<Filter>IO</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\Main\main.cpp">
|
||||
@ -92,5 +98,8 @@
|
||||
<ClCompile Include="..\..\src\System\Debug.cpp">
|
||||
<Filter>System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\IO\Input.cpp">
|
||||
<Filter>IO</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,4 +1,4 @@
|
||||
#ifdef _WIN32_
|
||||
#ifdef _WIN32
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
@ -7,12 +7,13 @@
|
||||
#include "../glx/wglext.h"
|
||||
#include "GLWindow.h"
|
||||
#include "Game.h"
|
||||
#include "../IO/Input.h"
|
||||
|
||||
typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*);
|
||||
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL;
|
||||
|
||||
GLWindow::GLWindow(HINSTANCE hInstance) :
|
||||
_isRunning(true),
|
||||
_isRunning(false),
|
||||
_game(NULL),
|
||||
_hinstance(hInstance),
|
||||
_lastTime(0)
|
||||
@ -181,6 +182,8 @@ LRESULT GLWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
// Make the GL3 context current.
|
||||
wglMakeCurrent(_hdc, _hglrc);
|
||||
_isRunning = true; // Mark our window as running now.
|
||||
|
||||
CreateInput();
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY: // Destroy window.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#ifdef _WIN32_ // Stop makefiles from complaining.
|
||||
#ifdef _WIN32 // Stop makefiles from complaining.
|
||||
#include <windows.h>
|
||||
#include <ctime>
|
||||
|
||||
|
@ -67,8 +67,7 @@ void Game::OnResize(int width, int height) {
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
||||
gluPerspective(45.0f, float(width) / float(height), 1.0f, 100.0f);
|
||||
glOrtho(0.0, 800.0, 0.0, 600.0, 0.0, 1.0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
Loading…
Reference in New Issue
Block a user