Search found 198 matches

by RandomDever
Tue Sep 24, 2013 11:56 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

I removed the PollEvent and PumpEvent and used as you suggested GetAsyncKeyState to move my square around and it holds at a smooth 60 fps. However I am assuming this is windows specific and I would prefer a cross-platform solution. I believe PollEvent implicitly calls PumpEvents so that specific fun...
by RandomDever
Tue Sep 24, 2013 3:37 am
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

It happens with seemingly all events.
One of the first things I tried before posting here was removing the SDL_PollEvent and just use SDL's keystates but the behavior is the same.
by RandomDever
Mon Sep 23, 2013 5:25 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

No I had not implemented that but now that I have limited it to 60 frames per second it still exhibits the same behavior. Because a frame limiter can only prevent it from going too high but the problem here is whenever ANY input is received the frame rate goes down.
by RandomDever
Sun Sep 22, 2013 9:13 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

The thing is I don't want to wait until my program is more complex to fix the problem. But before posting here I had a simple movement test running where a little image would move around responding to user key presses. But when holding down a key to move the image the frame rate kept slowing down an...
by RandomDever
Thu Sep 19, 2013 10:38 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

Going to town means rapidly scrolling up and down as fast as I can. All drawing code was removed to pinpoint the problem so all it does now is clear and swap. The problem I am trying to fix is the frame rate tanking like lead any time any input triggers an event. The mouse wheel event is simply the ...
by RandomDever
Wed Sep 18, 2013 7:59 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

Re: SDL Event Shenanigans

Code: Select all

bool InputManager::PollEvent()
{
    return SDL_PollEvent(&event);
}
bool InputManager::IsType(Uint32 type)
{
    return event.type == type;
}
by RandomDever
Wed Sep 18, 2013 5:24 pm
Forum: Programming Discussion
Topic: SDL Event Shenanigans
Replies: 15
Views: 8345

SDL Event Shenanigans

So I've used SDL for a while now and I always noticed a skippyness in my frame rate but only now realised what it is. It's not SDL's rendering function being slow it seems to be SDL event processing. When my game is running and all it's doing is looping through events and I go to town with the mouse...
by RandomDever
Sat Aug 25, 2012 8:39 pm
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

Re: OpenGL Failure

Well the problem in the test app seems to have fixed itself. I thought I was having the same problem with the engine but IDK the screen setup code is fine. Here's the problem in the engine:
Can anyone explain what would cause immediate mode to not render?
Keep in mind that VBOs render perfectly.
by RandomDever
Sat Aug 25, 2012 4:18 pm
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

Re: OpenGL Failure

Your state management looks absolutely atrocious. You have LoadIdentity's and PushMatrix's all over the place and in non-sensical places. I have no idea what you're trying to do, what it's supposed to do, or what other varieties of jacked up states you've got going on there from other places. ........
by RandomDever
Sat Aug 25, 2012 4:15 pm
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

Re: OpenGL Failure

That just fills the whole screen.
by RandomDever
Sat Aug 25, 2012 11:32 am
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

Re: OpenGL Failure

I changed that and it's still the same.
I had this working in my test game but then it just randomly stopped working but the VBOs still draw fine.
by RandomDever
Mon Aug 20, 2012 11:49 am
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

Re: OpenGL Failure

I can call that wherever I want and I still get the same result. #include "SDL.h" #include "SDL_opengl.h" #pragma comment( lib, "SDL.lib" ) #pragma comment( lib, "SDLmain.lib" ) #pragma comment( lib, "OpenGL32.lib" ) int main( int num, char **blarg )...
by RandomDever
Mon Aug 20, 2012 9:08 am
Forum: Programming Discussion
Topic: OpenGL Failure
Replies: 11
Views: 4016

OpenGL Failure

Here's the FULL source code: #include "SDL.h" #include "SDL_opengl.h" #pragma comment( lib, "SDL.lib" ) #pragma comment( lib, "SDLmain.lib" ) #pragma comment( lib, "OpenGL32.lib" ) int main( int num, char **blarg ) { SDL_Init( SDL_INIT_EVERYTHING ); ...
by RandomDever
Sat Aug 11, 2012 4:17 am
Forum: Programming Discussion
Topic: Window Modal Timing Problems
Replies: 2
Views: 1429

Re: Window Modal Timing Problems

How do I do that though?
I thought that's what SDL_EVENTTHREAD did but it still freezes every time I manipulate the window.
by RandomDever
Fri Aug 10, 2012 3:38 am
Forum: Programming Discussion
Topic: Window Modal Timing Problems
Replies: 2
Views: 1429

Window Modal Timing Problems

I have a timed trigger class that is not paused when I move the window or re-size the window or switch to another window.
Does anyone know how to fix this?
BTW I'm using SDL.