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.


Topics - Elffus

Pages: [1]
1
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.

2
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.

3
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]
anything