08.05.2013 Views

Curso de introducción a videojuegos multiplataforma con SDL

Curso de introducción a videojuegos multiplataforma con SDL

Curso de introducción a videojuegos multiplataforma con SDL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Curso</strong> <strong>de</strong> <strong>introducción</strong> a vi<strong>de</strong>ojuegos <strong>multiplataforma</strong> <strong>con</strong> <strong>SDL</strong><br />

Utilizando los eventos - III<br />

– Uint8 *<strong>SDL</strong>_GetKeyState(int * numTeclas);<br />

● Esta función <strong>de</strong>vuelve el estado actual <strong>de</strong>l<br />

teclado.<br />

● Devuelve un array <strong>de</strong> (*numTeclas) posiciones<br />

● Las posiciones están in<strong>de</strong>xadas por código <strong>de</strong><br />

la tecla (<strong>SDL</strong>K_a, etc)<br />

● Una posición a 1 significa que está pulsada, a<br />

0 significa que no<br />

● Para ir actualizando este array, tendremos que<br />

llamar a <strong>SDL</strong>_PumpEvents();<br />

● IMPORTANTE: No liberar el valor <strong>de</strong>vuelto<br />

© 2004 – Bruno González (STenyaK)<br />

Pablo Orduña (NcTrun)<br />

e-ghost – ESIDE – Universidad <strong>de</strong> Deusto

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!