# HG changeset patch # User terom # Date 1225921793 0 # Node ID 9b51949fdca641c34d98ac9c8419c13c801afa22 # Parent 75d873305ef3a36c6eccc33a6a4df93da43eaf70 fiddling with cmake linking diff -r 75d873305ef3 -r 9b51949fdca6 src/proto2/CMakeLists.txt --- a/src/proto2/CMakeLists.txt Wed Nov 05 21:22:15 2008 +0000 +++ b/src/proto2/CMakeLists.txt Wed Nov 05 21:49:53 2008 +0000 @@ -10,10 +10,12 @@ # Libraries # ClanLib 0.8 -find_package(ClanLib 0.8 REQUIRED COMPONENTS Core App Network) +find_package(ClanLib 0.8 REQUIRED COMPONENTS Core App Signals Display GL Sound Network) include_directories(${ClanLib_INCLUDE_DIRS}) set(LIBS ${LIBS} ${ClanLib_LIBRARIES}) +message("DEBUG: ${LIBS}") + # Assumes the project generates only one executable. If you need more, you'll need to alter # the script and replace ${PROJECT_SHORT_NAME} by executable name. add_executable("${PROJECT_SHORT_NAME}-p2" ${SOURCES}) diff -r 75d873305ef3 -r 9b51949fdca6 src/proto2/Drawer.cc --- a/src/proto2/Drawer.cc Wed Nov 05 21:22:15 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -#include -#include //do I need this in linux? -#include -#include -#include "GameState.hh" -#include "Dimension.hh" - -class CL_Game : public CL_ClanApplication { -private: - bool keep_going; - void check_input() { - if(CL_Keyboard::get_keycode(CL_KEY_ESCAPE)) - keep_going = false; - - LocalPlayer& lp = gs.getLocalPlayer(); - - if(CL_Keyboard::get_keycode(CL_KEY_UP)) { - lp.doMovement(PositionDelta(0,3)); - } - if(CL_Keyboard::get_keycode(CL_KEY_DOWN)) { - lp.doMovement(PositionDelta(0,-3)); - } - if(CL_Keyboard::get_keycode(CL_KEY_LEFT)) { - lp.doMovement(PositionDelta(-3,0)); - } - if(CL_Keyboard::get_keycode(CL_KEY_RIGHT)) { - lp.doMovement(PositionDelta(3,0)); - } - } - -public: - GameState gs; - - CL_Game() : keep_going(true) {} - virtual int main(int argc, char **argv) { - CL_SetupCore setup_init; - CL_SetupDisplay setup_disp; - CL_SetupGL setup_gl; - - //gs.player_list.push(Player(Coordinate())); - - CL_DisplayWindow win("ikkuna", 640, 480); -// CL_Surface bg(CL_PNGProvider("image.png"); - - unsigned int last_draw = CL_System::get_time(); - int r = 100, g = 100, b = 100; - unsigned int frame_count = 0; - bool R = false, G = false, B = false; - - while(keep_going) { //not good idea to put infinite loop - CL_Display::clear(CL_Color(r, g, b)); - - int colorIdx = 0; - for(std::list::iterator it = gs.player_list.begin(); it != gs.player_list.end(); ++it) { - - CL_Display::fill_rect(CL_Rect(it->getPosition().scaledX()-10, it->getPosition().scaledY()-10, - it->getPosition().scaledX()+10, it->getPosition().scaledY()+10), CL_Color((colorIdx*30)%255, (colorIdx*30)%255, (colorIdx*30)%255)); - - colorIdx++; - } - - CL_Display::flip(1); - frame_count++; - unsigned int cur_draw = CL_System::get_time(); - - check_input(); - - last_draw = cur_draw; - CL_System::keep_alive(); -// sleep(10); //flip already wait a short amount of time - } - return 0; - } -}; - -CL_Game inst; diff -r 75d873305ef3 -r 9b51949fdca6 src/proto2/Drawer.cc.disabled --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/proto2/Drawer.cc.disabled Wed Nov 05 21:49:53 2008 +0000 @@ -0,0 +1,76 @@ +#include +#include //do I need this in linux? +#include +#include +#include "GameState.hh" +#include "Dimension.hh" + +class CL_Game : public CL_ClanApplication { +private: + bool keep_going; + void check_input() { + if(CL_Keyboard::get_keycode(CL_KEY_ESCAPE)) + keep_going = false; + + LocalPlayer& lp = gs.getLocalPlayer(); + + if(CL_Keyboard::get_keycode(CL_KEY_UP)) { + lp.doMovement(PositionDelta(0,3)); + } + if(CL_Keyboard::get_keycode(CL_KEY_DOWN)) { + lp.doMovement(PositionDelta(0,-3)); + } + if(CL_Keyboard::get_keycode(CL_KEY_LEFT)) { + lp.doMovement(PositionDelta(-3,0)); + } + if(CL_Keyboard::get_keycode(CL_KEY_RIGHT)) { + lp.doMovement(PositionDelta(3,0)); + } + } + +public: + GameState gs; + + CL_Game() : keep_going(true) {} + virtual int main(int argc, char **argv) { + CL_SetupCore setup_init; + CL_SetupDisplay setup_disp; + CL_SetupGL setup_gl; + + //gs.player_list.push(Player(Coordinate())); + + CL_DisplayWindow win("ikkuna", 640, 480); +// CL_Surface bg(CL_PNGProvider("image.png"); + + unsigned int last_draw = CL_System::get_time(); + int r = 100, g = 100, b = 100; + unsigned int frame_count = 0; + bool R = false, G = false, B = false; + + while(keep_going) { //not good idea to put infinite loop + CL_Display::clear(CL_Color(r, g, b)); + + int colorIdx = 0; + for(std::list::iterator it = gs.player_list.begin(); it != gs.player_list.end(); ++it) { + + CL_Display::fill_rect(CL_Rect(it->getPosition().scaledX()-10, it->getPosition().scaledY()-10, + it->getPosition().scaledX()+10, it->getPosition().scaledY()+10), CL_Color((colorIdx*30)%255, (colorIdx*30)%255, (colorIdx*30)%255)); + + colorIdx++; + } + + CL_Display::flip(1); + frame_count++; + unsigned int cur_draw = CL_System::get_time(); + + check_input(); + + last_draw = cur_draw; + CL_System::keep_alive(); +// sleep(10); //flip already wait a short amount of time + } + return 0; + } +}; + +CL_Game inst;