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

Pages: [1]
1
Graphics / Multiple colors in a text using sf::String?
« on: October 03, 2010, 05:56:38 pm »
Quote from: "Hiura"
No, not with ONE sf::String/sf::Text. Use a container/class to store all your strings. (Take a look at the wiki, there may be something over there useful.)


Sweet.

So here's the answer to my own question  :P

http://www.sfml-dev.org/wiki/en/sources/richtext

Thanks.

2
Graphics / Multiple colors in a text using sf::String?
« on: October 03, 2010, 05:11:56 pm »
Hello there,

Is it possible to give a text some different colors by just drawing a sf::String?

For example: Hello world!

The text will be dynamic and prolly long, so I cannot simply make string objects with different colors.

If no, can you tell me an alternative way to do that?

Thanks  :)

3
General / Memory leaks in wxSFMLCanvas (wxWidgets example)
« on: April 27, 2010, 09:02:17 pm »
Hello there,

I followed this article: http://www.sfml-dev.org/tutorials/1.6/graphics-wxwidgets.php ..to integrate SFML 1.6 to wxWidgets.

I later used the provided custom wxSFMLCanvas control to add the SFML RenderWindow into my wxWidgets application, and I always get these memory leaks error every time I quit the application:

Quote
Detected memory leaks!
Dumping objects ->
{126} normal block at 0x003969A8, 20 bytes long.
 Data: < i9  i9  i9     > A8 69 39 00 A8 69 39 00 A8 69 39 00 CD CD CD CD
{125} normal block at 0x003967E0, 392 bytes long.
 Data: <                > A0 15 8F 00 01 00 00 00 01 00 00 00 00 00 00 00
{124} normal block at 0x003967A0, 4 bytes long.
 Data: < g9 > E0 67 39 00
Object dump complete.


So I tried to compile the source code from the tutorial (graphics-wxwidgets.cpp, wxSFMLCanvas.hpp, wxSFMLCanvas.cpp) under Microsoft Visual C++ 2008 to make sure that the leak didn't came from my codes, and yes, I got the same memory leaks.

I also tried to use the automatic leak detection by adding these lines on top of my source codes (as stated here: http://wiki.wxwidgets.org/Avoiding_Memory_Leaks):

Code: [Select]
#ifdef __WXMSW__
    #include <wx/msw/msvcrt.h>
#endif


But no success. It didn't show which files/lines caused that 3 leaks.

Is there a fix to this issue?

I am using SFML 1.6 with wxWidgets 2.8.10.

4
Graphics / Move, stretch, and draw sprites without modifying its pos?
« on: April 09, 2010, 07:46:02 pm »
I am sure that I'm using the VC 2008 build of SFML 1.6.

I couldn't even build this simple program with the static build:

Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow App;
App.Create(sf::VideoMode(800, 600, 32), "SFML Graphics");

    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }
        App.Clear();
        App.Display();
    }

    return 0;
}


Code: [Select]
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpmt.lib(string.obj)
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Main.obj
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Main.obj


Here is the setting I applied:
Code: [Select]
Release:
Linker > Input > Ignore Specific Library: libcmt
Linker > Input > Additional Dependencies: sfml-system-s.lib sfml-window-s.lib sfml-graphics-s.lib
C/C++ > Code Generation > Runtime Library: Multi-threaded (/MT)
C/C++ > Preprocessor > Preprocessor Definitions: - (none)


It compiles just fine if I use the DLL version.

5
Graphics / Move, stretch, and draw sprites without modifying its pos?
« on: April 09, 2010, 04:35:32 pm »
Hello.

Sorry for asking different question in the same thread.
But this still have something related to the conversion, so...


When I tried to build my game, the linker gave me TONS of linker errors:

Code: [Select]
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) already defined in libcpmtd.lib(stdthrow.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned int,unsigned int)const " (?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV12@II@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Swap_all(class std::_Container_base_secure &)const " (?_Swap_all@_Container_base_secure@std@@QBEXAAV12@@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (??1_Container_base_secure@std@@QAE@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (??0_Container_base_secure@std@@QAE@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(int)" (?width@ios_base@std@@QAEHH@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBEHXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmtd.lib(uncaught.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "bool __cdecl std::operator==<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z) already defined in Main.obj
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in Main.obj
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __gmtime64 already defined in LIBCMTD.lib(gmtime64.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fgetc already defined in LIBCMTD.lib(fgetc.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __wassert already defined in LIBCMTD.lib(wassert.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fseek already defined in LIBCMTD.lib(fseek.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _ftell already defined in LIBCMTD.lib(ftell.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _ldexp already defined in LIBCMTD.lib(_ldexp_.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _getenv already defined in LIBCMTD.lib(getenv.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function "bool __cdecl FrameFunc(void)" (?FrameFunc@@YA_NXZ)
Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Input::IsKeyDown(enum sf::Key::Code)const " (?IsKeyDown@Input@sf@@QBE_NW4Code@Key@2@@Z) referenced in function "bool __cdecl FrameFunc(void)" (?FrameFunc@@YA_NXZ)
Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (?Create@Window@sf@@QAEXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@2@@Z) referenced in function _main
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "public: void __thiscall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (?Create@Window@sf@@QAEXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@2@@Z)
Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: class sf::Input const & __thiscall sf::Window::GetInput(void)const " (?GetInput@Window@sf@@QBEABVInput@2@XZ) referenced in function "void __cdecl `dynamic initializer for 'Input''(void)" (??__EInput@@YAXXZ)
sfml-graphics-s-d.lib(Image.obj) : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::SetActive(bool)const " (?SetActive@Window@sf@@QBE_N_N@Z) referenced in function "public: bool __thiscall sf::Image::CopyScreen(class sf::RenderWindow &,class sf::Rect<int> const &)" (?CopyScreen@Image@sf@@QAE_NAAVRenderWindow@2@ABV?$Rect@H@2@@Z)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Window::SetActive(bool)const " (?SetActive@Window@sf@@QBE_N_N@Z)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Window::~Window(void)" (??1Window@sf@@UAE@XZ) referenced in function __unwindfunclet$??0RenderWindow@sf@@QAE@XZ$0
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: __thiscall sf::Window::Window(void)" (??0Window@sf@@QAE@XZ) referenced in function "public: __thiscall sf::RenderWindow::RenderWindow(void)" (??0RenderWindow@sf@@QAE@XZ)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "private: virtual void __thiscall sf::Window::OnEvent(class sf::Event const &)" (?OnEvent@Window@sf@@EAEXABVEvent@2@@Z)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Create(void *,struct sf::WindowSettings const &)" (?Create@Window@sf@@QAEXPAXABUWindowSettings@2@@Z) referenced in function "public: __thiscall sf::RenderWindow::RenderWindow(void *,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@PAXABUWindowSettings@1@@Z)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: unsigned int __thiscall sf::Window::GetWidth(void)const " (?GetWidth@Window@sf@@QBEIXZ) referenced in function "public: virtual unsigned int __thiscall sf::RenderWindow::GetWidth(void)const " (?GetWidth@RenderWindow@sf@@UBEIXZ)
sfml-graphics-s-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: unsigned int __thiscall sf::Window::GetHeight(void)const " (?GetHeight@Window@sf@@QBEIXZ) referenced in function "public: virtual unsigned int __thiscall sf::RenderWindow::GetHeight(void)const " (?GetHeight@RenderWindow@sf@@UBEIXZ)
sfml-graphics-s-d.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Context::SetActive(bool)" (?SetActive@Context@sf@@QAEX_N@Z) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)
sfml-graphics-s-d.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: static class sf::Context & __cdecl sf::Context::GetGlobal(void)" (?GetGlobal@Context@sf@@SAAAV12@XZ) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)
sfml-graphics-s-d.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl sf::Context::IsContextActive(void)" (?IsContextActive@Context@sf@@SA_NXZ) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)


Any idea?  :?

I'm trying to compile it with the static build of sfml-graphics and sfml-system in Microsoft Visual C++ 2008.

6
Graphics / Move, stretch, and draw sprites without modifying its pos?
« on: April 09, 2010, 03:42:43 pm »
Sorry but I couldn't see something like "Sprite::SetWidth()" or "Sprite::SetHeight()".

Only Sprite::SetScale which takes factor to resize the object.

7
Graphics / Move, stretch, and draw sprites without modifying its pos?
« on: April 08, 2010, 06:41:52 pm »
Okay maybe I will try to make a lot of sprites. (varying from 1000 to 3000 sprites to draw. Will it be OK?)

And what about "RenderStretch" function equivalent in SFML?

8
Graphics / Move, stretch, and draw sprites without modifying its pos?
« on: April 08, 2010, 12:36:41 pm »
Hello there,

I am currently converting my game which is previously created with Haaf's Game Engine (http://hge.relishgames.com) to SFML for portability (HGE relies on DirectX), but I'm having problem with SFML's RenderWindow::Draw() function.

It is written in C++.

Here is my original code with HGE:
Code: [Select]
// Inside the drawing function (HGE separates the rendering task in a function)
for(int i = 0; i < numObjects; i++)
{
  // nPosY1/nPosY2 is always changing
  float objPosY1 = 200.0f - nPosY1[i];
  float objPosY2 = 200.0f - nPosY2[i];
  // s_Note is a sprite
  // RenderStretch(float x1, float y1, float x2, float y2);
  s_Note->RenderStretch(33.0f, objPosY1, 33.0f + 28.0f, objPosY2); // x1, y1, x2, y2
}


As you can see above, I used the same sprite (s_Note) to draw a same image on various positions on the screen without modifying the sprite position.

Also it can stretch and draw the stretched sprite.

How can I achieve the same goal in SFML?
Since each sprite has its own position, it means I have to create many sprites to draw the same image in a different position. (and I don't want to do that)

And I can't see a similar "RenderStretch" function in SFML.

Code: [Select]
for(int i = 0; i < numObjects; i++)
{
  float objPosY1 = 200.0f - nPosY1[i];
  float objPosY2 = 200.0f - nPosY2[i];
  // ???????????????????????
}


Any kind of help would be appreciated.  :D

Pages: [1]
anything