Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Dylan_DE

Member Since 19 Sep 2011
Offline Last Active Dec 08 2013 09:37 AM

Posts I've Made

In Topic: [SDL] Every time I move the mouse the sprite redraws need help.

06 December 2012 - 12:20 PM

My fault I forgot to clear the screen problem solved thanks for all the help!

In Topic: [SDL] Every time I move the mouse the sprite redraws need help.

06 December 2012 - 10:49 AM

It still

1) You don't need to call SDL_ShowCursor on every cycle. Call this function before the main loop.

2) Personally, I think is better to check SDL_PollEvent on a "while" like this:

[source lang="cpp"]while(SDL_PollEvent(&event)){ // Handle events here}[/source]
3) Put the function apply_surface() after manage the events. You must separate the event manager code and the draw code. (Just put that apply_surface() before the SDL_Flip(), on the place where SDL_ShowCursor() is actually.)




It still draws the sprite every time even after I moved the apply_surface() and changed it to while(SDL_PollEvent(&event)).

In Topic: [SDL] Help with keyboard input and sprite movement

05 December 2012 - 01:35 PM

Nvm i figured it out. Thanks for all the help!

In Topic: [SDL] Help with keyboard input and sprite movement

05 December 2012 - 10:32 AM

So where do I put the apply_surface because i put it after the poll event like this
[source lang="cpp"]while (!done) { if (SDL_PollEvent(&event)) { if (event.type == SDL_QUIT) { done = true; } Uint8* keystate = SDL_GetKeyState(NULL); if(keystate[SDLK_DOWN]) { y = y+1; } } apply_surface(x, y, sprite, screen); }[/source]

In Topic: Java game programing help.

07 February 2012 - 07:19 AM

I am not trying to have a animation play i just want the image facing the direction you are moving, and thank you for the link it actually helped me solve another problem i was having.

PARTNERS