Some c++ testing

This commit is contained in:
Gulum
2017-10-23 18:52:24 +02:00
parent 9676c44ef2
commit 9130a45795
7 changed files with 55 additions and 56 deletions

17
src/DarkRP2D.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include "DarkRP2D.h"
void DarkRP2D::create() {
}
void DarkRP2D::loop(float deltaTime) {
}
void DarkRP2D::resize() {
}
void DarkRP2D::dispose() {
}

12
src/DarkRP2D.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef DARKRP2D_H
#define DARKRP2D_H
class DarkRP2D {
public:
void create();
void loop(float deltaTime);
void resize();
void dispose();
};
#endif // DARKRP2D_H

15
src/DesktopLauncher.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include <iostream>
#include <SDL2/SDL.h>
#include "DarkRP2D.h"
const int WIDTH = 800, HEIGHT = 600;
int main(int argc, char *argv[]) {
SDL_Init( SDL_INIT_EVERYTHING );
DarkRP2D* darkRP2D = new DarkRP2D();
SDL_Quit( );
return EXIT_SUCCESS;
}

View File

@@ -1,50 +0,0 @@
#include <iostream>
#include <SDL2/SDL.h>
#include <Box2D/Box2D.h>
#include <entityx/entityx.h>
const int WIDTH = 800, HEIGHT = 600;
/*
* If 'main' is defined we clear that definition
* to get our default 'main' function back.
*/
int main( int argc, char *argv[] ) {
SDL_Init( SDL_INIT_EVERYTHING );
//Box2D world just testing
b2World *world = new b2World(b2Vec2(0.0f, 98.f));
//entityx testing
entityx::EntityX ex;
entityx::Entity entity = ex.entities.create();
SDL_Window *window = SDL_CreateWindow( "Hello SDL World", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_ALLOW_HIGHDPI );
// Check that the window was successfully created
if ( NULL == window )
{
// In the case that the window could not be made...
std::cout << "Could not create window: " << SDL_GetError( ) << std::endl;
return 1;
}
SDL_Event windowEvent;
while ( true )
{
if ( SDL_PollEvent( &windowEvent ) )
{
if ( SDL_QUIT == windowEvent.type )
{
break;
}
}
}
SDL_DestroyWindow( window );
SDL_Quit( );
return EXIT_SUCCESS;
}

0
src/test/temp.cpp Normal file
View File

3
src/test/test.cpp Normal file
View File

@@ -0,0 +1,3 @@
void hello() {
}