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 - iride

Pages: 1 ... 4 5 [6]
76
Audio / Re: sf::Music trying to solve non-copy problem with "move"
« on: November 10, 2012, 03:07:08 am »
I really hope not>:(
That'd throw support for any compiler pre-0x out the window, which is bad.
Use a pointer or implement move in NonCopyable yourself if you need it that much, zlib license permits that.

 :-[ Sorry, I thought it was something that can be conditionally compiled

77
Audio / Re: sf::Music trying to solve non-copy problem with "move"
« on: November 10, 2012, 02:14:35 am »
Laurent, Can move assignment operator and constructor implemented for sf::NonCopyable?

78
Audio / Re: sf::Music trying to solve non-copy problem with "move"
« on: November 10, 2012, 01:12:17 am »
Your std::move has no effect, there's still a copy (resourceMap[name]=...).

You have to use pointers.
Shouldn't it invoke unordered_maps' move assignment operator because I called std::make_pair and std::move?

79
Audio / sf::Music trying to solve non-copy problem with "move"
« on: November 09, 2012, 10:54:03 pm »
I'm making a music resource manager class and I'm storing sf::Music in a unordered_map

std::unordered_map<std::string, std::pair<int, sf::Music>> resourceMap;

And it seems that I must use a reference or a smart pointer to store the music because of non-copyable
But instead of using this, I tried to get around with using move constructor...

resourceMap[name]=std::make_pair(1, std::move(sf::Music())); //Create the resource using "move"
                resourceMap[name].second.openFromFile(name); //load the resource
                std::cout<<"Loading "<<name<<" for the first time\n";

But it doesn't work
Errors I get...
1>c:\users\park\desktop\my sdks\include\sfml\system\mutex.hpp(89): error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
1>          c:\users\park\desktop\my sdks\include\sfml\system\noncopyable.hpp(79) : see declaration of 'sf::NonCopyable::operator ='
1>          c:\users\park\desktop\my sdks\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Mutex &sf::Mutex::operator =(const sf::Mutex &)'

80
Graphics / Re: sf::Text throws an exception
« on: October 31, 2012, 03:47:48 am »
I see the reason why the exception is thrown.
The API has changed and you'll have to go with the change and not try to work around it, thus every sf::Text need a valid sf::Font (okay you can also use the default constructor, for which the sf::Text then doesn't have a a reference to a sf::Font object).
I don't quite understand what you're saying here though.
with only using the default constructor, the text never gets rendered.
sf::Text text //use a default constructor
text.setString(sf::String("hello, world!"));
window.draw(text)//nothing gets rendered without loading a font

So to use sf::Text, I must load a font from a .ttf file?

81
Graphics / sf::Text throws an exception
« on: October 31, 2012, 03:12:09 am »
I figured that the constructor of sf::Text no longer has Font::getDefaultFont() as its second default argument.
so I just put sf::Text("...", sf::Font()), but this throws an exception.
But when I predefine a font object with its default constructor, it doesn't throw an exception. why?

I also just realized that either way doesn't render any text onto the screen.

 #include <SFML/Graphics.hpp>
 
 int main()
 {

     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
     
     //Exception
     sf::Text text("Exception thrown because of this->", sf::Font());
     
     //no exception
     //sf::Font font;
     //sf::Text text("Exception not thrown here", font);
 
     while (window.isOpen())
     {
         sf::Event event;
         while (window.pollEvent(event))
         {
             if (event.type == sf::Event::Closed)
                 window.close();
         }
         window.clear();
         window.draw(text);
         window.display();
     }
 
     return EXIT_SUCCESS;
 }
 

82
General / Re: SFML 2.0 with VS 2012
« on: October 29, 2012, 03:25:50 pm »
Ok, I'll go with DLLs. Is this going to be fixed someday?

83
General / Re: SFML 2.0 with VS 2012
« on: October 29, 2012, 03:15:42 pm »
Still getting linker errors in both release/debug build

debug
1>sfml-graphics-s-d.lib(jerror.obj) : warning LNK4217: locally defined symbol _exit imported in function _error_exit
1>sfml-graphics-s-d.lib(jerror.obj) : warning LNK4217: locally defined symbol ___iob_func imported in function _output_message
1>sfml-graphics-s-d.lib(jerror.obj) : warning LNK4217: locally defined symbol _sprintf imported in function _format_message
1>sfml-graphics-s-d.lib(jdatadst.obj) : warning LNK4217: locally defined symbol _fwrite imported in function _empty_output_buffer
1>sfml-graphics-s-d.lib(jdatadst.obj) : warning LNK4217: locally defined symbol _free imported in function _empty_mem_output_buffer
1>sfml-graphics-s-d.lib(jmemnobs.obj) : warning LNK4049: locally defined symbol _free imported
1>sfml-graphics-s-d.lib(jdatadst.obj) : warning LNK4217: locally defined symbol _malloc imported in function _empty_mem_output_buffer
1>sfml-graphics-s-d.lib(jmemnobs.obj) : warning LNK4049: locally defined symbol _malloc imported
1>sfml-graphics-s-d.lib(jdatadst.obj) : warning LNK4217: locally defined symbol _ferror imported in function _term_destination
1>sfml-graphics-s-d.lib(jdatadst.obj) : warning LNK4217: locally defined symbol _fflush imported in function _term_destination
1>sfml-graphics-s-d.lib(jmemmgr.obj) : warning LNK4217: locally defined symbol _getenv imported in function _jinit_memory_mgr
1>sfml-graphics-s-d.lib(jerror.obj) : error LNK2019: unresolved external symbol __imp__fprintf referenced in function _output_message
1>sfml-graphics-s-d.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol __imp__sscanf referenced in function _jinit_memory_mgr
1>c:\users\park\documents\visual studio 2012\Projects\SFML\Debug\SFML.exe : fatal error LNK1120: 2 unresolved externals

release
1>sfml-graphics-s.lib(jerror.obj) : error LNK2001: unresolved external symbol __imp__fprintf
1>sfml-graphics-s.lib(jmemmgr.obj) : error LNK2001: unresolved external symbol __imp__sscanf
1>c:\users\park\documents\visual studio 2012\Projects\SFML\Release\SFML.exe : fatal error LNK1120: 2 unresolved external

84
General / Re: SFML 2.0 with VS 2012
« on: October 29, 2012, 06:10:49 am »
I managed to build it with Cmake. I'm using static libraries instead of dynamic libraries.
I'm getting bunch of linking errors right now.
What I did:
  • Built SFML in Multi-Threaded runtime library setting with VS 2012
  • Created a new project and set the additional include and library directories
  • put sfml-graphics-s.lib and sfml-window-s.lib in the additional dependencies (release)
  • put sfml-graphics-s-d.lib and sfml-window-s-d.lib in the additional dependencies (debug)
  • defined SFML_STATIC
  • set the Runtime Library to Multi-Threaded

Error messages in debug build
1>------ Build started: Project: TESTR, Configuration: Debug Win32 ------
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::close(void)" (__imp_?close@Window@sf@@QAEXXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QBE_NXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (__imp_?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (__imp_?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IABUContextSettings@1@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (__imp_?setFillColor@Shape@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (__imp_??0CircleShape@sf@@QAE@MI@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (__imp_??1CircleShape@sf@@UAE@XZ) referenced in function _main
1>Source.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::Color const sf::Color::Green" (__imp_?Green@Color@sf@@2V12@B)
1>Source.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class sf::RenderStates const sf::RenderStates::Default" (__imp_?Default@RenderStates@sf@@2V12@B)
1>c:\users\park\documents\visual studio 2012\Projects\TESTR\Debug\TESTR.exe : fatal error LNK1120: 15 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

in release
1>------ Build started: Project: TESTR, Configuration: Release Win32 ------
1>sfml-graphics-s.lib(Shape.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Color.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(RenderStates.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(CircleShape.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(RenderTarget.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Transform.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Transformable.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(VertexArray.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Texture.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Image.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(View.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(Shader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(GLCheck.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(TextureSaver.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-graphics-s.lib(ImageLoader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(Window.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(VideoMode.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(GlContext.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(WindowImpl.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(VideoModeImpl.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(WglContext.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(JoystickManager.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(WindowImplWin32.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(locale0.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(ios.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(iosptrs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(locale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(xlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(xthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(wlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(xlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>libcpmt.lib(xdateord.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Source.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-graphics-s.lib(Texture.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::Mutex(void)" (??0Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(GlResource.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::Mutex(void)" (??0Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::Mutex(void)" (??0Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::Mutex(void)" (??0Mutex@sf@@QAE@XZ)
1>sfml-graphics-s.lib(Texture.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::~Mutex(void)" (??1Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(GlResource.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::~Mutex(void)" (??1Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::~Mutex(void)" (??1Mutex@sf@@QAE@XZ)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Mutex::~Mutex(void)" (??1Mutex@sf@@QAE@XZ)
1>sfml-graphics-s.lib(Texture.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::Lock(class sf::Mutex &)" (??0Lock@sf@@QAE@AAVMutex@1@@Z)
1>sfml-window-s.lib(GlResource.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::Lock(class sf::Mutex &)" (??0Lock@sf@@QAE@AAVMutex@1@@Z)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::Lock(class sf::Mutex &)" (??0Lock@sf@@QAE@AAVMutex@1@@Z)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::Lock(class sf::Mutex &)" (??0Lock@sf@@QAE@AAVMutex@1@@Z)
1>sfml-graphics-s.lib(Texture.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::~Lock(void)" (??1Lock@sf@@QAE@XZ)
1>sfml-window-s.lib(GlResource.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::~Lock(void)" (??1Lock@sf@@QAE@XZ)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::~Lock(void)" (??1Lock@sf@@QAE@XZ)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Lock::~Lock(void)" (??1Lock@sf@@QAE@XZ)
1>sfml-graphics-s.lib(ImageLoader.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-window-s.lib(WglContext.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-window-s.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-graphics-s.lib(Texture.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-graphics-s.lib(Image.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-graphics-s.lib(Shader.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-graphics-s.lib(GLCheck.obj) : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl sf::err(void)" (?err@sf@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@XZ)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "class sf::Time __cdecl sf::seconds(float)" (?seconds@sf@@YA?AVTime@1@M@Z)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "bool __cdecl sf::operator!=(class sf::Time,class sf::Time)" (??9sf@@YA_NVTime@0@0@Z)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "class sf::Time __cdecl sf::operator-(class sf::Time,class sf::Time)" (??Gsf@@YA?AVTime@0@V10@0@Z)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ)
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "public: class sf::Time __thiscall sf::Clock::getElapsedTime(void)const " (?getElapsedTime@Clock@sf@@QBE?AVTime@2@XZ)
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2001: unresolved external symbol "public: class sf::Time __thiscall sf::Clock::getElapsedTime(void)const " (?getElapsedTime@Clock@sf@@QBE?AVTime@2@XZ)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "public: class sf::Time __thiscall sf::Clock::restart(void)" (?restart@Clock@sf@@QAE?AVTime@2@XZ)
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2001: unresolved external symbol "public: class sf::Time __thiscall sf::Clock::restart(void)" (?restart@Clock@sf@@QAE?AVTime@2@XZ)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "void __cdecl sf::sleep(class sf::Time)" (?sleep@sf@@YAXVTime@1@@Z)
1>sfml-window-s.lib(WindowImpl.obj) : error LNK2001: unresolved external symbol "void __cdecl sf::sleep(class sf::Time)" (?sleep@sf@@YAXVTime@1@@Z)
1>sfml-window-s.lib(Window.obj) : error LNK2001: unresolved external symbol "public: static class sf::Time const sf::Time::Zero" (?Zero@Time@sf@@2V12@B)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::ThreadLocal::ThreadLocal(void *)" (??0ThreadLocal@sf@@QAE@PAX@Z)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: __thiscall sf::ThreadLocal::~ThreadLocal(void)" (??1ThreadLocal@sf@@QAE@XZ)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: void __thiscall sf::ThreadLocal::setValue(void *)" (?setValue@ThreadLocal@sf@@QAEXPAX@Z)
1>sfml-window-s.lib(GlContext.obj) : error LNK2001: unresolved external symbol "public: void * __thiscall sf::ThreadLocal::getValue(void)const " (?getValue@ThreadLocal@sf@@QBEPAXXZ)
1>sfml-window-s.lib(WindowImpl.obj) : error LNK2001: unresolved external symbol "class sf::Time __cdecl sf::milliseconds(int)" (?milliseconds@sf@@YA?AVTime@1@H@Z)
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2001: unresolved external symbol "class sf::Time __cdecl sf::milliseconds(int)" (?milliseconds@sf@@YA?AVTime@1@H@Z)
1>sfml-window-s.lib(JoystickImpl.obj) : error LNK2001: unresolved external symbol "bool __cdecl sf::operator>(class sf::Time,class sf::Time)" (??Osf@@YA_NVTime@0@0@Z)
1>c:\users\park\documents\visual studio 2012\Projects\TESTR\Release\TESTR.exe : fatal error LNK1120: 19 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

85
General / SFML 2.0 with VS 2012
« on: October 29, 2012, 12:38:51 am »
How can I use sfml with vs 2012

86
Window / cannot pass RenderWindow object by const reference
« on: September 05, 2012, 04:29:03 am »
I have a game object that receives reference to RenderWindow object
And this game.draw passes the const reference to window further down to menu object also as a const reference

game.draw(const sf::RenderWindow & r)
{
   menu.draw(r);
}

Using the window reference, menu object draws some stuff.

menu.draw(const sf::RenderWindow & r)
{
    r.draw(/*draw some stuff here*/);
}


when I try to pass the window object by const reference I get an error
"overloads have no legal conversion for 'this' pointer"

Why can't I do this?

87
Window / Re: window title displaying junk
« on: August 23, 2012, 08:52:23 pm »
Thanks, i solved the problem.

I noticed that I didn't have to call glFlush() to render

does window.display() include glFlush()?

88
Window / window title displaying junk
« on: August 23, 2012, 06:20:40 pm »

#pragma comment(lib, "sfml-graphics.lib")
#pragma comment(lib, "sfml-window.lib")
#pragma comment(lib, "sfml-system.lib")
#pragma comment(lib, "sfml-audio.lib")


#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")


#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Audio.hpp>

int main()
{
    // create the window
        sf::Window window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Close, sf::ContextSettings());
             

    // load resources, initialize the OpenGL states, ...
        glClearColor (0.0, 0.0, 0.0, 0.0);
        glClear (GL_COLOR_BUFFER_BIT);
        glColor3f (1.0, 1.0, 1.0);
        glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);


    // run the main loop
    bool running = true;
    while (running)
    {
        // handle events
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
            {
                // end the program
                running = false;
            }
            else if (event.type == sf::Event::Resized)
            {
                // adjust the viewport when the window is resized
                glViewport(0, 0, event.size.width, event.size.height);
            }
        }

        // clear the buffers
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // draw...
                glBegin(GL_POLYGON);
                        glVertex3f (0.25, 0.25, 0.0);
                        glVertex3f (0.75, 0.25, 0.0);
                        glVertex3f (0.75, 0.75, 0.0);
                        glVertex3f (0.25, 0.75, 0.0);
                glEnd();



        // end the current frame (internally swaps the front and back buffers)
        window.display();
    }

    // release resources...

    return 0;
}

The above code is displaying junk window title, not "OpenGL".
What did I do wrong?
I'm using 2.0

Pages: 1 ... 4 5 [6]