Some c++ testing
This commit is contained in:
17
src/DarkRP2D.cpp
Normal file
17
src/DarkRP2D.cpp
Normal 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
12
src/DarkRP2D.h
Normal 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
15
src/DesktopLauncher.cpp
Normal 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;
|
||||
}
|
||||
50
src/main.cpp
50
src/main.cpp
@@ -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
0
src/test/temp.cpp
Normal file
3
src/test/test.cpp
Normal file
3
src/test/test.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
void hello() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user