Add windows specific changes

This commit is contained in:
2020-09-12 13:09:20 +02:00
parent dc819016a6
commit 99c5c7fb9e
3 changed files with 22 additions and 0 deletions
+12
View File
@@ -7,7 +7,14 @@
#include <thread>
#include <chrono>
#include <mutex>
#ifdef _WIN32
#include "../SDL2/SDL2_framerate.h"
#include <ctime>
#include <string>
#include <windows.h>
#else
#include <SDL2/SDL2_framerate.h>
#endif // UNIX
std::vector< std::shared_ptr< SDLPP::RenderObject > > line_coliders{};
@@ -35,7 +42,11 @@ void prepareShadowColider(std::shared_ptr<SDLPP::Renderer> r) {
g_shadow_colider->centerX();
}
#ifdef _WIN32
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR szCmdLine, int nCmdShow) {
#else
int main() {
#endif
SDLPP::init();
SDLPP::Window w( "Tetris clone!" );
w.setResizable(true);
@@ -74,6 +85,7 @@ int main() {
g_input_functions.push_back(mainSceneInput);
while ( !g_quit ) {
SDL_PumpEvents();
SDL_framerateDelay( &gFPS );
if ( !g_cur_object && g_checked_line ) {
std::lock_guard< std::mutex > guard( g_movement_mutex );