Which line exactly does this happen on?
Visual Studio just takes me to a line in "MutexImpl.cpp"
void MutexImpl::lock()
{
EnterCriticalSection(&m_mutex);
}
ntdll.dll!776af592() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> Genesis.exe!sf::priv::MutexImpl::lock() Line 52 C++
Genesis.exe!sf::Mutex::lock() Line 57 C++
Genesis.exe!sf::Lock::Lock(sf::Mutex & mutex) Line 39 C++
Genesis.exe!sf::GlResource::GlResource() Line 49 C++
Genesis.exe!sf::Window::Window() Line 48 C++
Genesis.exe!`dynamic initializer for 'WindowManager::renderWindow''() Line 5 C++
Genesis.exe!_initterm(void (void) * * pfbegin, void (void) * * pfend) Line 894 C
Genesis.exe!_cinit(int initFloatingPrecision) Line 290 C
Genesis.exe!__tmainCRTStartup() Line 226 C
Genesis.exe!mainCRTStartup() Line 164 C
kernel32.dll!75008543() Unknown
ntdll.dll!776bac69() Unknown
ntdll.dll!776bac3c() Unknown
Sorry, I thought you'er passing copies of your manager.
It's ok.
All I want the manager to do, is store the Window, and then have everything else in the program reference to that variable that is being stored in it. Would that work alright? Or would there be a better way?
The reason I placed all those functions in WindowManager is because I figured if WindowManager was storing the Window itself, it should also be the class that interacts with it.
Basically, inheritance(without anything virtual) is gluing a class or few together with few new functions and variables. Inherited class(without anything virtual) acts exactly like the base class would so can use it just like base. ie. use Yay class as normal render window.
Pointers are used when you don't want to duplicate resources but acess and/or modify them from few places. Ie. sf::Sprites take reference of sf::Texture and store a pointer to it so 100 sprites can use 1 texture.
I understand inheritance somewhat. To what class in your example are things being glues to? Yay? I'm just a little confused as to what really makes it different from just having a class with methods inside of it. *I understand that it is probably a more efficient method but for someone who never used it, ....its just a little confusing. *
So I was poking around playing with inheritance a little... is this code proper?
void WindowManager::SetFramerateLimit(short int a)
{
if(a>60)
a=60;
if(a<15)
a=15;
WindowManager::SetFramerateLimit(a); //I think this means I setup inheritance right.
}
^Yes I understand that that is completely useless having that in a function like that but I was just practicing..... If It works I can delete all those excess functions I suppose. But How does it know what to adjust? I mean, sure I can do "WindowManager::SetFramerateLimit(a);" but how does it know what window its setting the framerate limit on?
Pointers make a lot of sense to me, more so than inheritance at this point, but they just seem slightly confusing at first as to how to actually implement them and use them properly. Especially if you start talking about moving pointers between classes.
Also back to Window Managment..... If the sf::Window can't be static... how would I make everything non static and still be able to access it? I seem to always run into this issue, where I have to make one thing static, and then because of that, everything else has to be static because its accessing something that's static, or referencing from something static.... Kinda forcing me to keep using static functions and variables. >_<
Thanks a ton for your help so far by the way.