1
SFML projects / Veggie Snake [casual game]
« on: May 27, 2011, 05:03:57 pm »
Looks nice and simple
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable
# to tell CMake where SFML is.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FRIBIDI_LIBRARY
linked by target "mars" in directory C:/Users/Philipp/Documents/C++/MARS/src
TAG_LIBRARY
linked by target "mars" in directory C:/Users/Philipp/Documents/C++/MARS/src
Index: cmake/modules/FindSFML.cmake
===================================================================
--- cmake/modules/FindSFML.cmake (Revision 200)
+++ cmake/modules/FindSFML.cmake (Arbeitskopie)
@@ -31,7 +31,8 @@
/opt/local/ # DarwinPorts
/opt/csw/ # Blastwave
/opt/
- ${SFMLDIR})
+ ${SFMLDIR}
+ C:/MinGW)
# check the version number
set(SFML_VERSION_OK TRUE)
@@ -68,7 +69,8 @@
/opt/local
/opt/csw
/opt
- ${SFMLDIR})
+ ${SFMLDIR}
+ C:/MinGW)
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (Revision 200)
+++ CMakeLists.txt (Arbeitskopie)
@@ -29,7 +29,7 @@
include_directories(${OPENGL_INCLUDE_DIR})
# find the sfml2 headers and library
-find_package(SFML REQUIRED graphics system audio window)
+find_package(SFML REQUIRED audio graphics window system)
include_directories(${SFML_INCLUDE_DIR})
# Foundation library needed for apple
@@ -46,7 +46,7 @@
find_library(TAG_LIBRARY tag)
# Fribidi library needed for bi-directional texts
- find_library(FRIBIDI_LIBRARY fribidi)
+ find_library(FRIBIDI_LIBRARY fribidi-0)
# set the executable output path
if(APPLE)
Would this be correct? What else is missing? It won't let me store bool values or strings inside the class though.
class Item
{
public:
Item(string equip, string title, int atk, int price, int slot, bool stack);
string GetEquip();
string GetEquipTitle();
int GetEquipAtk();
// ...
private:
string Equip;
string EquipTitle;
int EquipAtk;
int EquipPrice;
int EquipSlot;
bool EquipStack;
};
Item sword("Sword", "Sword_Title", 20, 30, 1, false)
//...
cout << sword.GetEquipAtk() << endl;
Don't worry it does.
And, there is an error on your gluPerspective ratio, App.GetWidth() and App.GetHeight() need to be casted to float numbers like this :
SFML uses its own OpenGL statements, so you should include all your opengl calls within App.SaveGLStates(); and App.RestoreGLStates();
More specifically, it must be used around code that calls Draw functions. Example:http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderTarget.php#a17e9740485c9c72553971c1f75f96a16
// OpenGL code here...
window.SaveGLStates();
window.Draw(...);
window.Draw(...);
window.RestoreGLStates();
// OpenGL code here...
C:\Users\Philipp\Documents\C++\pysfml2-cython>python setup.py build_ext --inplac
e
running build_ext
cythoning sf.pyx to sf.cpp
building 'sf' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\Py
thon27\include -Ic:\Python27\PC -c sf.cpp -o build\temp.win32-2.7\Release\sf.o
sf.cpp: In function 'PyObject* __pyx_pf_2sf_11SoundBuffer_7samples___get__(PyObj
ect*)':
sf.cpp:7838: warning: comparison between signed and unsigned integer expressions
sf.cpp: In function 'void __Pyx_RaiseArgtupleInvalid(const char*, int, Py_ssize_
t, Py_ssize_t, Py_ssize_t)':
sf.cpp:38407: warning: unknown conversion type character 'z' in format
sf.cpp:38407: warning: format '%s' expects type 'char*', but argument 5 has type
'Py_ssize_t'
sf.cpp:38407: warning: unknown conversion type character 'z' in format
sf.cpp:38407: warning: too many arguments for format
sf.cpp: In function 'void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t)':
sf.cpp:38625: warning: unknown conversion type character 'z' in format
sf.cpp:38625: warning: format '%s' expects type 'char*', but argument 3 has type
'Py_ssize_t'
sf.cpp:38625: warning: too many arguments for format
sf.cpp: In function 'void __Pyx_RaiseTooManyValuesError(Py_ssize_t)':
sf.cpp:38633: warning: unknown conversion type character 'z' in format
sf.cpp:38633: warning: too many arguments for format
sf.cpp: In function 'PyObject* __pyx_pf_2sf_5Image_14get_tex_coords(PyObject*, P
yObject*)':
sf.cpp:15063: warning: '__pyx_v_p' is used uninitialized in this function
writing build\temp.win32-2.7\Release\sf.def
C:\Program Files\CodeBlocks\MinGW\bin\g++.exe -mno-cygwin -mdll -static --entry
_DllMain@12 --output-lib build\temp.win32-2.7\Release\libsf.a --def build\temp.w
in32-2.7\Release\sf.def -s build\temp.win32-2.7\Release\sf.o -Lc:\Python27\libs
-Lc:\Python27\PCbuild -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-system -
lpython27 -lmsvcr90 -o C:\Users\Philipp\Documents\C++\pysfml2-cython\sf.pyd
g++: build\temp.win32-2.7\Release\libsf.a: No such file or directory
error: command 'g++' failed with exit status 1