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

Pages: [1]
1
Graphics / GUI with resolution changes
« on: September 26, 2011, 04:49:50 pm »
Thanks a lot, that really helps! :)

2
Graphics / GUI with resolution changes
« on: September 26, 2011, 04:29:35 pm »
On the topic of defining rules how would you recommend approaching the task? Would a parameter saying whether the passed co-ords are coming from the top left, top right, bottom left, bottom right or centre be effective?

Thanks again for your help!

3
Graphics / GUI with resolution changes
« on: September 26, 2011, 04:21:02 pm »
So if I created a button at the bottom centre of a screen sized 800 x 600 and resized it to 1680 x 1050 how would the button know where to move to?

I presume I'd need to create some kind of GUI co-ordinates and use them instead of pixel co-ordinates, to that the button knows where to re-position itself?

I'm trying to create a GUI base that uses Lua & xml. An example would be the WoW UI Interface. When you change your resolution the elements automatically stick to where they were created.

Thanks for your help.

4
Graphics / Inherit from sf::Sprite
« on: September 25, 2011, 01:15:01 am »
I thought the base class destructor only needed to be virtual if the base class was being deleted. If you derive from sf::Sprite and delete the derived class it should work perfectly. Actually I don't even think sf::Sprite has a destructor.

5
Graphics / GUI with resolution changes
« on: September 24, 2011, 07:30:56 pm »
Hi,

I'm really struggling to understand how to draw a gui to the screen then have it persist in the same relative positions even when the resolution has changed.

For example; an action bar that sticks to the bottom of the screen as well as a button that floats directly in the middle of the screen.

I understand that to change the resolution of a window you recall .Create with the new resolution. This causes everything drawn to the screen to remain in the same place without scaling. However, GUI elements will remain in the same position when they need to sort of expand to there original position (for example, something more to the left would be further to the left if the resolution increased, or something to the right would be further from the right if the resolution decreased).

I figured each element could just have it's own code to reposition it using the original arithmetic to set its position. However, is there no way of making all elements complete this task in the same way?

As well as this when the window is manually resized, via dragging the corners or maximising the screen, how does one stop the gui elements from resizing but keep them in the same relative position (as described above)?

Thanks for any help, I really can't wrap my head around this.

6
General / Linker Errors
« on: April 03, 2011, 10:43:09 pm »
Turns out moving all the files from the /build/lib/Release and /build/lib/Debug directories into ../lib/ caused it to work perfectly.

7
General / Drawing tilemap is lowering my fps to a crawl
« on: April 03, 2011, 05:09:00 pm »
If tiles aren't being constantly changed wouldn't it be easier to store them in an sf::Image and only perform changes when necessary? Showing one big image is much faster than loads of smaller ones I believe.

8
General / Linker Errors
« on: April 03, 2011, 05:03:26 pm »
Hi,

So after searching every thread on google and coming to no solution I decided to question here. Recently I downloaded SFML via git and compiled it,  this seemed to work flawlessly with no errors (I compiled in Release and Debug, VS2010).

I then proceeded to make a new project and copy in the .dll files from the debug library to my project folder (sfml-audio-d-2.dll, sfml-graphics-d-2.dll, sfml-network-d-2.dll, sfml-system-d-2.dll, sfml-window-d-2.dll).

After doing this I went into the property pages window and, under VC++ Directories, set my include directory to the SFML-2.0\include folder and the library directories to the SFML-2.0\build\lib folder. I then set SFML_DYNAMIC as the preprocessor definition, and changed my additional dependencies to:
sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
sfml-main-d.lib

After doing this I used code similar to that of the clock tutorial and created a clock that ran for 5 seconds. It worked perfectly with no errors. I then proceeded to use the following code:

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

int main()
{
sf::Window App(sf::VideoMode(800,600,32), "Window");
while ( true )
{
App.Display();
}
return EXIT_SUCCESS;
}


Which returned the following:

Quote
1>------ Build started: Project: DENG, Configuration: Debug Win32 ------
1>Build started 03/04/2011 16:02:08.
1>InitializeBuildStatus:
1>  Touching "Debug\DENG.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@1@@Z) referenced in function _main
1>D:\C++\DENG\Debug\DENG.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.44
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Does anyone have any suggestions as to what I've done/am doing wrong? It's probably something really obvious that I missed. Thanks.

9
General / VC2010 & SFML 2.0
« on: August 18, 2010, 11:29:50 am »
Ah, I see, I must use ContextSettings instead. Thanks again!

11
General / VC2010 & SFML 2.0
« on: August 18, 2010, 01:35:45 am »
Sorry to double post, but I'm now experiencing trouble with "WindowSettings"

Code: [Select]
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>Build started 18/08/2010 00:34:10.
1>InitializeBuildStatus:
1>  Touching "Debug\Game.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>d:\c++\learning\game\main.cpp(9): error C2039: 'WindowSettings' : is not a member of 'sf'
1>d:\c++\learning\game\main.cpp(9): error C2065: 'WindowSettings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(9): error C2146: syntax error : missing ';' before identifier 'Settings'
1>d:\c++\learning\game\main.cpp(9): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(10): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(10): error C2228: left of '.DepthBits' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(11): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(11): error C2228: left of '.StencilBits' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(12): error C2065: 'Settings' : undeclared identifier
1>d:\c++\learning\game\main.cpp(12): error C2228: left of '.AntialiasingLevel' must have class/struct/union
1>          type is ''unknown-type''
1>d:\c++\learning\game\main.cpp(15): error C2065: 'Settings' : undeclared identifier
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.42
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


It errors this, from this code:

Code: [Select]
sf::WindowSettings Settings;
Settings.DepthBits = 24;
Settings.StencilBits = 8;
Settings.AntialiasingLevel = 8;

// Create the window.
sf::RenderWindow App( sf::VideoMode( 800, 600, 32 ), "Connect 4", sf::Style::Close, Settings );


When I remove the Settings however it works perfectly?  :?

12
General / VC2010 & SFML 2.0
« on: August 17, 2010, 11:19:39 pm »
Ah, it unticked the inherited values option for some reason, thanks!  :D

13
General / VC2010 & SFML 2.0
« on: August 17, 2010, 11:10:01 pm »
For some reason VC2010 outputs all of these errors when trying to build:

Code: [Select]
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>Build started 17/08/2010 22:02:23.
1>InitializeBuildStatus:
1>  Touching "Debug\Game.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-window-s-d.lib(VideoModeImpl.obj) : error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsA@12 referenced in function "public: static class std::vector<class sf::VideoMode,class std::allocator<class sf::VideoMode> > __cdecl sf::priv::VideoModeImpl::GetFullscreenModes(void)" (?GetFullscreenModes@VideoModeImpl@priv@sf@@SA?AV?$vector@VVideoMode@sf@@V?$allocator@VVideoMode@sf@@@std@@@std@@XZ)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__GetDC@4
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__ShowWindow@8
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "public: __thiscall sf::priv::WglContext::WglContext(class sf::priv::WglContext *)" (??0WglContext@priv@sf@@QAE@PAV012@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__DestroyWindow@4
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2001: unresolved external symbol __imp__ReleaseDC@8
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function "public: virtual void __thiscall sf::priv::WglContext::Display(void)" (?Display@WglContext@priv@sf@@UAEXXZ)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WglContext.obj) : error LNK2019: unresolved external symbol __imp__DescribePixelFormat@16 referenced in function "private: void __thiscall sf::priv::WglContext::CreateContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?CreateContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowLongA@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(void *)" (??0WindowImplWin32@priv@sf@@QAE@PAX@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(void *)" (??0WindowImplWin32@priv@sf@@QAE@PAX@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__AdjustWindowRect@12 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetDeviceCaps@8 referenced in function "public: __thiscall sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long)" (??0WindowImplWin32@priv@sf@@QAE@VVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@K@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DestroyIcon@4 referenced in function "public: virtual __thiscall sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UAE@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__WaitMessage@0 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ProcessEvents(bool)" (?ProcessEvents@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ShowMouseCursor(bool)" (?ShowMouseCursor@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::ShowMouseCursor(bool)" (?ShowMouseCursor@WindowImplWin32@priv@sf@@EAEX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetCursorPos@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetCursorPosition(unsigned int,unsigned int)" (?SetCursorPosition@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__ClientToScreen@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetCursorPosition(unsigned int,unsigned int)" (?SetCursorPosition@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowPos@28 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetPosition(int,int)" (?SetPosition@WindowImplWin32@priv@sf@@EAEXHH@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetWindowLongA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetSize(unsigned int,unsigned int)" (?SetSize@WindowImplWin32@priv@sf@@EAEXII@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SetWindowTextA@8 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetTitle(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?SetTitle@WindowImplWin32@priv@sf@@EAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__SendMessageA@16 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetIcon(unsigned int,unsigned int,unsigned char const *)" (?SetIcon@WindowImplWin32@priv@sf@@EAEXIIPBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__CreateIcon@28 referenced in function "private: virtual void __thiscall sf::priv::WindowImplWin32::SetIcon(unsigned int,unsigned int,unsigned char const *)" (?SetIcon@WindowImplWin32@priv@sf@@EAEXIIPBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::RegisterWindowClass(void)" (?RegisterWindowClass@WindowImplWin32@priv@sf@@AAEXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassW@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::RegisterWindowClass(void)" (?RegisterWindowClass@WindowImplWin32@priv@sf@@AAEXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsA@8 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::SwitchToFullscreen(class sf::VideoMode const &)" (?SwitchToFullscreen@WindowImplWin32@priv@sf@@AAEXABVVideoMode@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__TrackMouseEvent@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::ProcessEvent(unsigned int,unsigned int,long)" (?ProcessEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__ScreenToClient@8 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::ProcessEvent(unsigned int,unsigned int,long)" (?ProcessEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__GetAsyncKeyState@4 referenced in function "private: void __thiscall sf::priv::WindowImplWin32::ProcessEvent(unsigned int,unsigned int,long)" (?ProcessEvent@WindowImplWin32@priv@sf@@AAEXIIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__MapVirtualKeyA@8 referenced in function "private: static enum sf::Key::Code __cdecl sf::priv::WindowImplWin32::VirtualKeyCodeToSF(unsigned int,long)" (?VirtualKeyCodeToSF@WindowImplWin32@priv@sf@@CA?AW4Code@Key@3@IJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::GlobalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?GlobalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::GlobalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?GlobalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z)
1>sfml-window-s-d.lib(WindowImplWin32.obj) : error LNK2019: unresolved external symbol __imp__CallWindowProcA@20 referenced in function "private: static long __stdcall sf::priv::WindowImplWin32::GlobalOnEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?GlobalOnEvent@WindowImplWin32@priv@sf@@CGJPAUHWND__@@IIJ@Z)
1>D:\C++\Learning\Game\Debug\Game.exe : fatal error LNK1120: 41 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.86
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here is what my settings look like:





And I'm using the SFML 2.0 libraries someone posted on the forum here for VC2010. Any ideas as to why it wont build?

Pages: [1]