Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - Phys1k3r

Pages: [1]
1
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 27, 2012, 02:08:18 pm »
You somehow mix around libraries and debug/release modes.
Make sure that all the settings are the same.

Create a new and empty project and follow 1:1 the official tutorial and link against your compiled SFML version.

Ok,
I did the tutorial from here: http://www.sfml-dev.org/tutorials/2.0/start-vc.php

and it works with the 32 Bit libraries...

When I do the same on my project, it does not work.
It is very strange, that the same code works with the 32 bit version, but not with the 64 bit...

2
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 27, 2012, 01:41:10 pm »
Hey,
I did the clean and rebuild, but I still get the same errors.

Do you have any solution for me?

3
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 26, 2012, 05:19:19 pm »
sf::Font wunderbar_font;
//load font
sf::Text danke=sf::Text::Text("Ach mein Gott!",wunderbar_font);
 
Also don't write sf::Text::Text, just sf::Text would work too.
There are 3 c-tors, default(), copy(other text) and from string, font(since removal of default font, can't be ommited) and size(size can be ommited). Compiler can't convert single argument of type string to match one of these. The error is actually telling you that blantly:"Not all arguments could be converted by all 3 Overloads"

it is strange, because it works with the 32 bit Libraries

Edit: And I got even more confusing errors in the post before that. For now I try your code

4
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 26, 2012, 05:08:25 pm »
Hello again:
I have compiled SFML 2.0 and I got all the debug and release libraries and dlls.

When I want to compile my project, I get these errors: (Had to translate it from german in to english, as I only have a german visual studio. I'd prefer an english one, but I don't have one)

1>  angleControl.cpp
1>angleControl.cpp(17): error C2665: "sf::Text::Text": Not all arguments could be converted by all 3 Overloads
1>          D:\sfml\include\SFML/Graphics/Text.hpp(293): can 'sf::Text::Text(const sf::Text &)' bei while adjusting the argument list '(const wchar_t [2])''

code I use is:
        phiText         = sf::Text::Text("TEST");
 
EDIT:
I just excluded these lines of my project, now I get these errors: (I am sorry for the german errors, I will only translate the first ones)

Quote
>sfml-graphics-s-d.lib(Shape.obj) : error LNK2038: Conflict detected for "_ITERATOR_DEBUG_LEVEL": The Value "2" is not equal to "0" in angleControl.obj.
1>sfml-graphics-s-d.lib(Text.obj) : error LNK2038:  Conflict detected for "_ITERATOR_DEBUG_LEVEL": The Value "2" is not equal to "0" in angleControl.obj.
1>sfml-graphics-s-d.lib(Color.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Transformable.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(CircleShape.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(RenderTarget.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(RenderStates.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(RectangleShape.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(VertexArray.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Texture.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Transform.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Font.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(View.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(GLCheck.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Shader.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(Image.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(TextureSaver.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-graphics-s-d.lib(ImageLoader.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(Window.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(VideoMode.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(GlContext.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(WindowImpl.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(VideoModeImpl.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(JoystickManager.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-window-s-d.lib(JoystickImpl.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-system-s-d.lib(String.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-system-s-d.lib(Err.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>sfml-system-s-d.lib(ThreadLocal.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __cdecl std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QEAAPEAV123@XZ) ist bereits in sfml-graphics-s-d.lib(Texture.obj) definiert.
1>libcpmtd.lib(stdthrow.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(locale0.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)"

(?_Facet_Register@facet@locale@std@@CAXPEAV123@@Z) is already defined in msvcprt.lib(locale0_implib.obj) .
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ) is already defined in msvcprt.lib(MSVCP100.dll) .
1>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPEAV_Locimp@12@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(xdebug.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(ios.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(iosptrs.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(xlock.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "2" stimmt nicht mit dem Wert "0" in angleControl.obj überein.
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QEAA@H@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: _configthreadlocale ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __cdecl std::exception::exception(char const * const &)" (??0exception@std@@QEAA@AEBQEBD@Z) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __cdecl std::exception::exception(class std::exception const &)" (??0exception@std@@QEAA@AEBV01@@Z) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __cdecl std::exception::~exception(void)" (??1exception@std@@UEAA@XZ) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual char const * __cdecl std::exception::what(void)const " (?what@exception@std@@UEBAPEBDXZ) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __cdecl std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QEAA@PEBD@Z) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __cdecl std::bad_cast::bad_cast(class std::bad_cast const &)" (??0bad_cast@std@@QEAA@AEBV01@@Z) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __cdecl std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UEAA@XZ) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(invarg.obj) : error LNK2005: _invalid_parameter ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(lconv.obj) : error LNK2005: localeconv ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: sprintf ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: sprintf_s ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: _XcptFilter ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: exit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _cexit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _amsg_exit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _initterm_e ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(mlock.obj) : error LNK2005: _lock ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(mlock.obj) : error LNK2005: _unlock ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0.obj) : error LNK2005: mainCRTStartup ist bereits in MSVCRT.lib(crtexe.obj) definiert.
1>LIBCMTD.lib(errmode.obj) : error LNK2005: __set_app_type ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: __xi_a ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: __xi_z ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: __xc_a ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: __xc_z ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(tolower.obj) : error LNK2005: tolower ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(_file.obj) : error LNK2005: __iob_func ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(_file.obj) : error LNK2005: _lock_file ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(_file.obj) : error LNK2005: _unlock_file ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LIBCMTD.lib(fflush.obj) : error LNK2005: fflush ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
1>LINK : warning LNK4098: Standardbibliothek "MSVCRT"  is in conflict with outher libraries; /NODEFAULTLIB:Bibliothek verwenden.
1>LINK : warning LNK4098: Standardbibliothek "LIBCMTD"  is in conflict with outher libraries; /NODEFAULTLIB:Bibliothek verwenden.
1>LINK : warning LNK4098: Standardbibliothek "LIBCMT" is in conflict with outher libraries; /NODEFAULTLIB:Libraries  usage
1>C:\Users\osmin\Documents\Visual Studio 2010\Projects\calibrationControl\x64\Debug\calibrationControl.exe : fatal error LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

5
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 26, 2012, 04:07:27 pm »
Those who can read have a clear advantage. FRex had already pointed out to read the tutorial where everything would've been explained.
Also can you explain to me why you download the package for Visual Studio 2008 when you could've downloaded the version for Visual Studio 2010, which would match your IDE version? ???

To make it again clear, there are no precompiled binaries for VS10 x64, so you'll have to compile SFML 2 on your own as described in the tutorial.

Jeah, reading every detail is not my strength  ;)
Sometimes everybody misses something. I thought it would be enough, if I load the package from the offical site.

It was another mistake of me. Yes, of course I loaded the version for VC 2010. I was just a in hurry, because I got a little pressure here!

By now, compiling has worked, but I does not work with my project. I will post more information in a few minutes, when I checked more things.

6
General / Re: SFML 2.0 on Visual Studio 2010 64Bit
« on: September 26, 2012, 03:06:35 pm »
hey,
I loaded this version of SFML: Windows - Visual C++ 2008 (7.20 MB)

when I open CMake and I have to choose where to finde the source code, I just the folder where the whole project is located:

When I try to compile I get this error message:
"CMake Error:  The source directory "C:/SFML2.0/cmake/Modules) does not appear to contain CMakelists.txt.
Specify -help for usage, or press the help button on the CMake GUI."

Maybe I have the wrong installe package of SFML?

thank you!

EDIT: I searched the whole package for a CMakelists.txt but I haven't found it!

7
General / SFML 2.0 on Visual Studio 2010 64Bit
« on: September 26, 2012, 02:44:41 pm »
Hey,
I need SFML 2.0 to run on a project with Visual Studio 2010 that is compiled on 64 Bit systems...

Are there any precompiled libraries I can use for that?

Or do I have to compile them myself? And if I need so, how do I do that?

I already asked google, but I haven't found an answer. It is very important for me to have a fast solution for this problem.

thank you for your time!

8
Graphics / Re: Creating your own drawable objects
« on: September 07, 2012, 05:11:57 pm »
You shouldn't call .draw of any drawable.
Quote
Note that inheriting from sf::Drawable is not mandatory, but it allows this nice syntax "window.draw(object)" (...) which is more consistent with other SFML classes.

ah, crap.
I've read this several times, but I had no real clue what it meant!
Thank you!

9
Graphics / Re: Creating your own drawable objects
« on: September 07, 2012, 04:58:27 pm »
Hmmm maybe it's just me, but I don't understand what you really want to do...
If you want to draw your own geometry things, you may want to use sf::ConvexShape and handle the points on your own, or go directly to sf::VertexArray.

hm, I've seen this method. But I don't think ConvexShape is what I need.

Quote
If you don't know how to derive from classes and implement the virtual functions, then you haven't understood some basic OOP stuff, which you can read up on various knowledge sources (better FRex? ::) ).

If you understand OOP, then you should maybe take a look at sf::Drawable and sf::Transformable in the SFML documentation. Those base classes can be used to create your own drawable and transformable object.
I know the basics of OOP and the idea of OOP, as I come from java, but I still have troubles with implementation in C++.
I had look at drawable too and even think, that this could be more usefull than using Shape. I have to revise OOP, propably you're right and my knowledge in OPP is too short
Quote
So what exactly do you mean by that line:
Quote
For a project I need to paint 3 objects. (2 coordinatesystems, 1 scale).

I need to decelop a window where you can see 3 constant Objects.
The first object is a coordinate System. On the surface of this coordsystem I want to display a moving point, which coordinates are transmitted by an extern program.

I made a small picture in paint, so you can see what I have in mind.

I thought it is useful to make a class for each of this objects, as I have to make some calculations and some data a transmitted. I didn't want to put all in the window method.

I hope you understand, what I want to do.

Edit:
@FRex

Hey, I already experimented with Drawable.

In the end, I was not able to call the MyDrawable.draw(RenderTarget,RenderStates) method,
because I was not able to transform my RenderWindow into a RenderTarget?

I found this quite strange, as I thought, RenderWindow inherits from RenderTarget, but I had no Idea to solve this


Edit2:
wow, I testet it now with this command:

window.draw(myDrawableTest); // myDrawableTest is a object I generated from myDrawable
and it works!!! Thank you FRex and eXpl0it3r!

I almost had the same code like you before, but I didn't try to use window.draw( ... ).



[attachment deleted by admin]

10
Graphics / Creating your own drawable objects
« on: September 07, 2012, 04:23:10 pm »
Hello,
I am just a beginner in C++ and even more a beginner in SFML. I use SFML 2.0 with Visual Studio 2010.

For a project I need to paint 3 objects. (2 coordinatesystems, 1 scale).
I wanted to create a class for each object and than I wanted to draw the object on my window.

I created a window with this
 
main(){
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

// I had something in mind like doing this:

zControl zCon;                      // zControl is the scale class I want to print
xyControl xyCon;                  // xyControl is on coord System I want to draw
angleControl angleCon;       // angleControl is the orther coord System I want to draw

... // do some other stuff

window.draw(zCon);
window.draw(xyCon);
window.draw(angleCon);

... // do other stuff
}


One class is called  zControl, this should be one of the objects, I want to draw.

class zControl : public sf::Shape
{
public:
        zControl(void);
        ~zControl(void);
};
 

I thought that if I inherit from Shape could be a useful Idea, but I do not really know how to do it. I know the basics of abstract classes, but I have no idea how to realize it.

Unfortunately I do understand the tutorials, but there is not explained how to solve my problems.
The Tutorials just show me how to paint Rectangles, Strings, Circles, etc...
I assume it is pretty basic, but I tried a lot of things now for a long time and nothing seems to work.

Pages: [1]
anything