Original Post
Is it expensive to have an SDL Event as a local variable in a function that is called numerous times? I.e. does the creation of an SDL Event have any significant performance implications?
Quote:
Original post by Palidine
[google]: SDL_Event: http://sdl.beuc.net/sdl.wiki/SDL_Event
it's tiny
-me
Quote:
Original post by triqer
Obviously I went to that page, but unless I'm missing something it doesn't give any information regarding the amount of memory it takes up.
Quote:In any case -- and this is the more important point -- the size of a structure does not affect the time needed to allocate it as a local variable. Stack allocations are basically free.
typedef union{ // In other words, I take up only as much space as the largest of my members!
Uint8 type; // I'm pretty small
SDL_ActiveEvent active; // Apparently I'm 3 bytes
SDL_KeyboardEvent key; // And I'm probably pretty small too
SDL_MouseMotionEvent motion; // etc... how much data could any of these really have?
SDL_MouseButtonEvent button;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_ResizeEvent resize;
SDL_ExposeEvent expose;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
} SDL_Event;
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more