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

Pages: [1]
1
Window / GetEvent always returns true
« on: December 30, 2009, 02:17:02 am »
Hi again,

I seem to have a problem with events when I migrate my code to linux and gcc

Here is a snippet of my game loop:

Code: [Select]

void StateManager::startRendering()
{
mRunning = true;
while (mRunning)
{
while (mRenderWindow->GetEvent(mEvent))
{
if (mEvent.Type == Event::Closed)
{
mRunning = false;
}
else if(mEvent.Type == Event::KeyPressed)
{
mStates.back()->keyPressed((Event::KeyEvent&)mEvent.Key);
}
else if(mEvent.Type == Event::KeyReleased)
{
mStates.back()->keyReleased((Event::KeyEvent&)mEvent.Key);
}
}

mRenderWindow->Clear();

if(mStates.back()->frameRender(*mRenderWindow))
{
                 mRunning = false;
}

mRenderWindow->Display();
}

mRenderWindow->Close();
}


This code works fine on windows and VC++, but in linux the event while loop --> while (mRenderWindow->GetEvent(mEvent)) <-- always returns true.
According to the debugger the first few events catched seems reasonable (Joy_Moved, Gained_Focus and Mouse_Entered)
After that it constantly receives the event Mouse_Moved.
The while loop never stops and obviously the code never reaches the actual rendering futher down.
I have tried to replace the while with an if, and then things start to work as expected. But I don't want to do that do I?

Am I overlooking something here or is this a bug?

2
Graphics / Sprite::GetCenter
« on: December 28, 2009, 05:33:20 pm »
Hello

I seem to have a strange problem with Sprite::GetCenter using the latest trunc from SVN. Basically, it always returns coordinates 0.0, 0.0

Is this a known issue?

My system is Windows 7 x64, VC++ 2008 express

3
General / GL_INVALID_OPERATION with sf::String
« on: December 26, 2009, 06:07:49 pm »
Hello

I see that this issue has been discussed before so I just thought I would add some info about it.

This is what I use:
Windows 7 x64
Visual C++ 2008 express edition
SFML 1.5 (Official stable download)

As soon as I declare a sf::String anywhere in the code I get the following error at program exit:
Code: [Select]

An internal OpenGL call failed in image.cpp (769) : GL_INVALID_OPERATION, the specified operation is not allowed in the
current state


I have also tried with the example code at this location
http://www.sfml-dev.org/tutorials/1.5/sources/graphics-sprite.cpp
and the same happens. As soon as I add a sf::String declaration I get the error.

I downloaded the latest trunc (Some issues with compilation due to my express version but I got the files I needed) but the error is still there.

By the way, the error only shows up when running in debug mode

edit:
After some more testing it seems to be the call to GetDefaultFont()

Pages: [1]
anything