|
From: <sch...@us...> - 2008-12-22 23:22:42
|
Revision: 59
http://deraciel.svn.sourceforge.net/deraciel/?rev=59&view=rev
Author: schnippi001
Date: 2008-12-22 21:37:44 +0000 (Mon, 22 Dec 2008)
Log Message:
-----------
GUI abstraction with interfaces
Modified Paths:
--------------
trunk/cpp/CMakeLists.txt
trunk/cpp/KeyboardReader.h
trunk/cpp/MapWindow.h
trunk/cpp/StatusWindow.h
trunk/cpp/TextWindow.h
trunk/cpp/main.cpp
Added Paths:
-----------
trunk/cpp/NCursesMapWindow.cpp
trunk/cpp/NCursesMapWindow.h
trunk/cpp/NCursesStatusWindow.cpp
trunk/cpp/NCursesStatusWindow.h
trunk/cpp/NCursesTextWindow.cpp
trunk/cpp/NCursesTextWindow.h
Removed Paths:
-------------
trunk/cpp/MapWindow.cpp
trunk/cpp/StatusWindow.cpp
trunk/cpp/TextWindow.cpp
Modified: trunk/cpp/CMakeLists.txt
===================================================================
--- trunk/cpp/CMakeLists.txt 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/CMakeLists.txt 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.6)
project(deraciel)
-SET(CMAKE_CXX_FLAGS "-Wall -Werror")
+SET(CMAKE_CXX_FLAGS "-Wall -Werror -g")
# requirements
find_library( NCURSES_LIBRARY ncurses )
Modified: trunk/cpp/KeyboardReader.h
===================================================================
--- trunk/cpp/KeyboardReader.h 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/KeyboardReader.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,11 +1,11 @@
class KeyboardReader {
- public:
- static void setKeyboardHandler(void (*handler)(const int key));
- static void startLoop();
- static void stop();
+public:
+ static void setKeyboardHandler(void (*handler)(const int key));
+ static void startLoop();
+ static void stop();
- private:
- static void (*keyboardHandler)(const int key);
- static bool keyboardReaderActive;
+private:
+ static void (*keyboardHandler)(const int key);
+ static bool keyboardReaderActive;
};
\ No newline at end of file
Deleted: trunk/cpp/MapWindow.cpp
===================================================================
--- trunk/cpp/MapWindow.cpp 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/MapWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,49 +0,0 @@
-#include "MapWindow.h"
-
-#include <iostream>
-#include <string>
-#include <ncurses.h>
-
-using namespace std;
-
-MapWindow::MapWindow() {
- window = newwin(maxHeight, maxWidth, 2, 0);
-
- if (!window) {
- cerr << "Error: Map window creation failed!" << endl;
- return;
- }
-
- wattron(window, COLOR_PAIR(4));
- wbkgd(window, COLOR_PAIR(4));
-
- wrefresh(window);
-}
-
-
-
-MapWindow::~MapWindow() {
- /* Free resources consumed by windows */
- delwin(window);
-}
-
-
-
-void MapWindow::resize() {
- /* Reallocate storage for resized text window */
- wresize(window, maxHeight, maxWidth);
-}
-
-
-
-void MapWindow::displayMap(const chtype *map) {
- /* Set cursor to first position (upper left) in map window */
- wmove(window, 0, 0);
-
- /* Copy map to local map */
- for (unsigned int s = 0; s < screensize; s++) {
- waddch(window, map[s]);
- }
-
- wnoutrefresh(window);
-}
Modified: trunk/cpp/MapWindow.h
===================================================================
--- trunk/cpp/MapWindow.h 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/MapWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,17 +1,20 @@
-#include <string>
-#include <ncurses.h>
+/*
+ * File: MapWindow.h
+ * Author: schnippi
+ *
+ * Created on 22. Dezember 2008, 20:47
+ */
+#ifndef _MAPWINDOW_H
+#define _MAPWINDOW_H
+
+#include "Map.h"
+
class MapWindow {
- public:
- MapWindow();
- ~MapWindow();
- void draw();
- void resize();
- void displayMap(const chtype *map);
+public:
+ virtual void resize() = 0;
+ virtual void displayMap(const Map *map) = 0;
+};
- private:
- WINDOW *window; // Window handle
- static const unsigned int maxWidth = 80; // Maximum window width
- static const unsigned int maxHeight = 20; // Maximum window height
- static const unsigned int screensize = maxWidth * maxHeight;
-};
\ No newline at end of file
+#endif /* _MAPWINDOW_H */
+
Copied: trunk/cpp/NCursesMapWindow.cpp (from rev 56, trunk/cpp/MapWindow.cpp)
===================================================================
--- trunk/cpp/NCursesMapWindow.cpp (rev 0)
+++ trunk/cpp/NCursesMapWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,38 @@
+#include "NCursesMapWindow.h"
+
+#include <iostream>
+#include <string>
+#include <ncurses.h>
+
+using namespace std;
+
+NCursesMapWindow::NCursesMapWindow() {
+ window = newwin(maxHeight, maxWidth, 2, 0);
+
+ if (!window) {
+ cerr << "Error: Map window creation failed!" << endl;
+ return;
+ }
+
+ wattron(window, COLOR_PAIR(4));
+ wbkgd(window, COLOR_PAIR(4));
+
+ wrefresh(window);
+}
+
+NCursesMapWindow::~NCursesMapWindow() {
+ /* Free resources consumed by windows */
+ delwin(window);
+}
+
+void NCursesMapWindow::resize() {
+ /* Reallocate storage for resized text window */
+ wresize(window, maxHeight, maxWidth);
+}
+
+void NCursesMapWindow::displayMap(const Map *map) {
+ /* Set cursor to first position (upper left) in map window */
+ wmove(window, 0, 0);
+
+ wnoutrefresh(window);
+}
Property changes on: trunk/cpp/NCursesMapWindow.cpp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/cpp/NCursesMapWindow.h (from rev 56, trunk/cpp/MapWindow.h)
===================================================================
--- trunk/cpp/NCursesMapWindow.h (rev 0)
+++ trunk/cpp/NCursesMapWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,18 @@
+#include <string>
+#include <ncurses.h>
+
+#include "MapWindow.h"
+
+class NCursesMapWindow : public MapWindow {
+public:
+ NCursesMapWindow();
+ ~NCursesMapWindow();
+ void resize();
+ void displayMap(const Map *map);
+
+private:
+ WINDOW *window; // Window handle
+ static const unsigned int maxWidth = 80; // Maximum window width
+ static const unsigned int maxHeight = 20; // Maximum window height
+ static const unsigned int screensize = maxWidth * maxHeight;
+};
Property changes on: trunk/cpp/NCursesMapWindow.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/cpp/NCursesStatusWindow.cpp (from rev 56, trunk/cpp/StatusWindow.cpp)
===================================================================
--- trunk/cpp/NCursesStatusWindow.cpp (rev 0)
+++ trunk/cpp/NCursesStatusWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,54 @@
+#include "NCursesStatusWindow.h"
+
+#include <iostream>
+#include <string>
+#include <ncurses.h>
+
+using namespace std;
+
+NCursesStatusWindow::NCursesStatusWindow() {
+ window = newwin(maxHeight, maxWidth, 25 - maxHeight, 0);
+
+ if (!window) {
+ cerr << "Error: Status window creation failed!" << endl;
+ return;
+ }
+
+ wattron(window, COLOR_PAIR(3));
+ wbkgd(window, COLOR_PAIR(3));
+
+ wrefresh(window);
+}
+
+NCursesStatusWindow::~NCursesStatusWindow() {
+ /* Free resources consumed by window */
+ delwin(window);
+}
+
+void NCursesStatusWindow::resize() {
+ /* Reallocate storage for resized text window */
+ wresize(window, maxHeight, maxWidth);
+}
+
+void NCursesStatusWindow::displayStatus() {
+ if (borderIsDrawn) {
+ /* Redraw border */
+ drawBorder();
+ }
+
+ mvwprintw(window, 1, 2, "$:%d HP:%d(%d) MP:%d(%d) St:%2d Dx:%2d Co:%2d Wi:%2d Wp:%2d Ch:%2d",
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+
+ mvwprintw(window, 2, 2, "%s Xp:%2d/%d T:%d S:%d",
+ "Deraciel", 0, 1, 2, 3);
+
+ wnoutrefresh(window);
+}
+
+/*
+ Private member function declarations
+ */
+
+void NCursesStatusWindow::drawBorder() {
+ wborder(window, 0, 0, 0, ' ', '/', '\\', ACS_VLINE, ACS_VLINE);
+}
Property changes on: trunk/cpp/NCursesStatusWindow.cpp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/cpp/NCursesStatusWindow.h (from rev 56, trunk/cpp/StatusWindow.h)
===================================================================
--- trunk/cpp/NCursesStatusWindow.h (rev 0)
+++ trunk/cpp/NCursesStatusWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,19 @@
+#include <string>
+#include <ncurses.h>
+
+#include "StatusWindow.h"
+
+class NCursesStatusWindow : public StatusWindow {
+public:
+ NCursesStatusWindow();
+ ~NCursesStatusWindow();
+ void resize();
+ void displayStatus();
+
+private:
+ WINDOW *window; // Window handle
+ static const unsigned int maxWidth = 80; // Maximum window width
+ static const unsigned int maxHeight = 3; // Maximum window height
+ static const bool borderIsDrawn = true; // Draw window borders by default
+ void drawBorder();
+};
\ No newline at end of file
Property changes on: trunk/cpp/NCursesStatusWindow.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/cpp/NCursesTextWindow.cpp (from rev 56, trunk/cpp/TextWindow.cpp)
===================================================================
--- trunk/cpp/NCursesTextWindow.cpp (rev 0)
+++ trunk/cpp/NCursesTextWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,68 @@
+#include "NCursesTextWindow.h"
+
+#include <iostream>
+#include <string>
+#include <ncurses.h>
+
+using namespace std;
+
+NCursesTextWindow::NCursesTextWindow() {
+ borderWindow = newwin(maxHeight, maxWidth, 0, 0);
+ textWindow = newwin(maxHeight - 1, maxWidth - 2, 0, 1);
+
+ if (!borderWindow || !textWindow) {
+ cerr << "Error: Text window creation failed!" << endl;
+ return;
+ }
+
+ wattron(borderWindow, COLOR_PAIR(1));
+ wbkgd(textWindow, COLOR_PAIR(1));
+
+ if (borderIsDrawn) {
+ /* Redraw border with new dimensions */
+ drawBorder();
+ }
+
+ wrefresh(borderWindow);
+ wrefresh(textWindow);
+}
+
+NCursesTextWindow::~NCursesTextWindow() {
+ /* Free resources consumed by windows */
+ delwin(borderWindow);
+ delwin(textWindow);
+}
+
+void NCursesTextWindow::resize() {
+ /* Reallocate storage for resized text window */
+ wresize(borderWindow, maxHeight, maxWidth);
+ wresize(textWindow, maxHeight - 1, maxWidth);
+}
+
+void NCursesTextWindow::clear() {
+ if (borderIsDrawn) {
+ /* Redraw border with new dimensions */
+ drawBorder();
+ }
+}
+
+void NCursesTextWindow::displayString(const string string) {
+ if (borderIsDrawn) {
+ /* Redraw border*/
+ drawBorder();
+ }
+
+ wmove(textWindow, 0, 0);
+ wprintw(textWindow, string.c_str());
+
+ wnoutrefresh(borderWindow);
+ wnoutrefresh(textWindow);
+}
+
+/*
+ Private member function declarations
+ */
+
+void NCursesTextWindow::drawBorder() {
+ wborder(borderWindow, 0, 0, ' ', 0, ACS_VLINE, ACS_VLINE, '\\', '/');
+}
\ No newline at end of file
Property changes on: trunk/cpp/NCursesTextWindow.cpp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/cpp/NCursesTextWindow.h (from rev 56, trunk/cpp/TextWindow.h)
===================================================================
--- trunk/cpp/NCursesTextWindow.h (rev 0)
+++ trunk/cpp/NCursesTextWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -0,0 +1,21 @@
+#include <string>
+#include <ncurses.h>
+
+#include "TextWindow.h"
+
+class NCursesTextWindow : public TextWindow {
+public:
+ NCursesTextWindow();
+ ~NCursesTextWindow();
+ void resize();
+ void clear();
+ void displayString(const std::string string);
+
+private:
+ WINDOW *borderWindow; // Window handle
+ WINDOW *textWindow; // Window handle
+ static const unsigned int maxWidth = 80; // Maximum window width
+ static const unsigned int maxHeight = 2; // Maximum window height
+ static const bool borderIsDrawn = true; // Draw window borders by default
+ void drawBorder();
+};
Property changes on: trunk/cpp/NCursesTextWindow.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Deleted: trunk/cpp/StatusWindow.cpp
===================================================================
--- trunk/cpp/StatusWindow.cpp 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/StatusWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,62 +0,0 @@
-#include "StatusWindow.h"
-
-#include <iostream>
-#include <string>
-#include <ncurses.h>
-
-using namespace std;
-
-StatusWindow::StatusWindow() {
- window = newwin(maxHeight, maxWidth, 25-maxHeight, 0);
-
- if (!window) {
- cerr << "Error: Status window creation failed!" << endl;
- return;
- }
-
- wattron(window, COLOR_PAIR(3));
- wbkgd(window, COLOR_PAIR(3));
-
- wrefresh(window);
-}
-
-
-
-StatusWindow::~StatusWindow() {
- /* Free resources consumed by window */
- delwin(window);
-}
-
-
-
-void StatusWindow::resize() {
- /* Reallocate storage for resized text window */
- wresize(window, maxHeight, maxWidth);
-}
-
-
-
-void StatusWindow::displayStatus() {
- if (borderIsDrawn) {
- /* Redraw border */
- drawBorder();
- }
-
- mvwprintw(window, 1, 2, "$:%d HP:%d(%d) MP:%d(%d) St:%2d Dx:%2d Co:%2d Wi:%2d Wp:%2d Ch:%2d",
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-
- mvwprintw(window, 2, 2, "%s Xp:%2d/%d T:%d S:%d",
- "Deraciel", 0, 1, 2, 3);
-
- wnoutrefresh(window);
-}
-
-
-
-/*
- Private member function declarations
-*/
-
-void StatusWindow::drawBorder() {
- wborder(window, 0, 0, 0, ' ', '/', '\\', ACS_VLINE, ACS_VLINE);
-}
Modified: trunk/cpp/StatusWindow.h
===================================================================
--- trunk/cpp/StatusWindow.h 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/StatusWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,17 +1,19 @@
-#include <string>
-#include <ncurses.h>
+/*
+ * File: StatusWindow.h
+ * Author: schnippi
+ *
+ * Created on 22. Dezember 2008, 20:47
+ */
+#ifndef _STATUSWINDOW_H
+#define _STATUSWINDOW_H
+
class StatusWindow {
- public:
- StatusWindow();
- ~StatusWindow();
- void resize();
- void displayStatus(void);
+public:
+ virtual void resize() = 0;
+ virtual void displayStatus() = 0;
+};
- private:
- WINDOW *window; // Window handle
- static const unsigned int maxWidth = 80; // Maximum window width
- static const unsigned int maxHeight = 3; // Maximum window height
- static const bool borderIsDrawn = true; // Draw window borders by default
- void drawBorder();
-};
\ No newline at end of file
+
+#endif /* _STATUSWINDOW_H */
+
Deleted: trunk/cpp/TextWindow.cpp
===================================================================
--- trunk/cpp/TextWindow.cpp 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/TextWindow.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,68 +0,0 @@
-#include "TextWindow.h"
-
-#include <iostream>
-#include <string>
-#include <ncurses.h>
-
-using namespace std;
-
-TextWindow::TextWindow() {
- borderWindow = newwin(maxHeight, maxWidth, 0, 0);
- textWindow = newwin(maxHeight-1, maxWidth-2, 0, 1);
-
- if (!borderWindow || !textWindow) {
- cerr << "Error: Text window creation failed!" << endl;
- return;
- }
-
- wattron(borderWindow, COLOR_PAIR(1));
- wbkgd(textWindow, COLOR_PAIR(1));
-
- if (borderIsDrawn) {
- /* Redraw border with new dimensions */
- drawBorder();
- }
-
- wrefresh(borderWindow);
- wrefresh(textWindow);
-}
-
-
-
-TextWindow::~TextWindow() {
- /* Free resources consumed by windows */
- delwin(borderWindow);
- delwin(textWindow);
-}
-
-
-
-void TextWindow::resize() {
- /* Reallocate storage for resized text window */
- wresize(borderWindow, maxHeight, maxWidth);
- wresize(textWindow, maxHeight-1, maxWidth);
-}
-
-
-
-void TextWindow::displayString(const string string) {
- if (borderIsDrawn) {
- /* Redraw border*/
- drawBorder();
- }
-
- wmove(textWindow, 0, 0);
- wprintw(textWindow, string.c_str());
-
- wnoutrefresh(borderWindow);
- wnoutrefresh(textWindow);
-}
-
-
-/*
- Private member function declarations
-*/
-
-void TextWindow::drawBorder() {
- wborder(borderWindow, 0, 0, ' ', 0, ACS_VLINE, ACS_VLINE, '\\', '/');
-}
\ No newline at end of file
Modified: trunk/cpp/TextWindow.h
===================================================================
--- trunk/cpp/TextWindow.h 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/TextWindow.h 2008-12-22 21:37:44 UTC (rev 59)
@@ -1,19 +1,21 @@
+/*
+ * File: TextWindow.h
+ * Author: schnippi
+ *
+ * Created on 22. Dezember 2008, 04:28
+ */
+
+#ifndef _DERACIEL_TEXTWINDOW_H
+#define _DERACIEL_TEXTWINDOW_H
+
#include <string>
-#include <ncurses.h>
class TextWindow {
- public:
- TextWindow();
- ~TextWindow();
- void resize();
- void clear();
- void displayString(const std::string string);
+public:
+ virtual void resize() = 0;
+ virtual void clear() = 0;
+ virtual void displayString(const std::string string) = 0;
+};
- private:
- WINDOW *borderWindow; // Window handle
- WINDOW *textWindow; // Window handle
- static const unsigned int maxWidth = 80; // Maximum window width
- static const unsigned int maxHeight = 2; // Maximum window height
- static const bool borderIsDrawn = true; // Draw window borders by default
- void drawBorder();
-};
\ No newline at end of file
+
+#endif /* _DERACIEL_TEXTWINDOW_H */
Modified: trunk/cpp/main.cpp
===================================================================
--- trunk/cpp/main.cpp 2008-12-04 10:06:31 UTC (rev 58)
+++ trunk/cpp/main.cpp 2008-12-22 21:37:44 UTC (rev 59)
@@ -2,9 +2,7 @@
#include <signal.h>
#include <ncurses.h>
-#include "TextWindow.h"
-#include "MapWindow.h"
-#include "StatusWindow.h"
+#include "NCursesGUI.h"
#include "KeyboardReader.h"
using namespace std;
@@ -14,83 +12,62 @@
static void finish(const int signum);
static void keyhandler(const int key);
+GUI *gui;
+
int main(int argc, char **argv) {
- signal(SIGINT, finish); /* arrange interrupts to terminate */
- initscr(); /* initialize the curses library */
- keypad(stdscr, TRUE); /* enable keyboard mapping */
- nonl(); /* tell curses not to do NL->CR/NL on output */
- //cbreak(); /* take input chars one at a time, no wait for \n */
- noecho(); /* don't echo input */
+ signal(SIGINT, finish); /* arrange interrupts to terminate */
- curs_set(0); /* Hide the cursor */
+ gui = new NCursesGUI();
+ gui->initialize();
- start_color();
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- init_pair(2, COLOR_BLACK, COLOR_YELLOW);
- init_pair(3, COLOR_WHITE, COLOR_RED);
- init_pair(4, COLOR_WHITE, COLOR_GREEN);
+ //gui->getStatusWindow->displayStatus();
- clear();
- refresh();
+ /* Assign key handler callback */
+ KeyboardReader::setKeyboardHandler(keyhandler);
- TextWindow textWindow;
- MapWindow mapWindow;
- StatusWindow statusWindow;
+ /* Start keyboard handler loop */
+ KeyboardReader::startLoop();
- statusWindow.displayStatus();
-
- //invt_init(&main_char.inventory);
-
- /* Assign key handler callback */
- KeyboardReader::setKeyboardHandler(keyhandler);
-
- /* Start keyboard handler loop */
- KeyboardReader::startLoop();
-
- finish(0);
- return 0;
+ finish(0);
+ return 0;
}
-
-
-void finish(const int signum)
-{
- /* If text window is still existing, destroy it */
-
- /* End ncurses library */
- endwin();
-
- /* Do your non-curses wrapup here */
-
+void finish(const int signum) {
+ gui->finalize();
}
+static void keyhandler(const int key) {
+ if (key == KEY_ESCAPE) {
+ // Stop keyboard handler loop
+ KeyboardReader::stop();
+ finish(0);
+ }
+ if (key == KEY_RESIZE) {
+ endwin();
+ curs_set(0); /* Hide the cursor */
-static void keyhandler(const int key)
-{
- if (key == KEY_ESCAPE) {
- // Stop keyboard handler loop
- KeyboardReader::stop();
- finish(0);
- }
+ clear();
+ refresh();
+ }
- if (key == KEY_RESIZE) {
- endwin();
- curs_set(0); /* Hide the cursor */
+ if (key == KEY_UP) {
+ cout << "KEY_UP" << endl;
+ }
- clear();
- refresh();
- }
+ if (key == KEY_DOWN) {
+ cout << "KEY_DOWN" << endl;
+ }
- if (key == KEY_DOWN) {
- cout << "KEY_DOWN" << endl;
- }
+ if (key == KEY_LEFT) {
+ cout << "KEY_LEFT" << endl;
+ }
- if (key == KEY_LEFT) {
- cout << "KEY_LEFT" << endl;
- }
+ if (key == KEY_RIGHT) {
+ cout << "KEY_RIGHT" << endl;
+ }
- if (key == KEY_RIGHT) {
- cout << "KEY_RIGHT" << endl;
- }
+ if (key == 'm') {
+ //gui->getTextWindow->displayString("Message displayed");
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|