[SDL] OS/2 port!

Ryan C. Gordon icculus at icculus.org
Tue Nov 22 23:32:31 PST 2005


#include "SDL.h"
#include "stdio.h"

int main(int argc, char *argv[])
{

	unsigned int Tecla;
	unsigned char Salir;

      SDL_Event event;

	Salir=0;
	while (Salir<1)
	{

		while (SDL_PollEvent(&event))
		{
			if (event.type==SDLK_UP)
			{
				printf("\nTecla pulsada");
				Salir=1;
			} else {
				printf("\nEsperando...");
			}

			keys=SDL_GetKeyState(NULL);

			if (keys[SDLK_UP])
			{

				printf("\nTecla pulsada");
				Salir=1;
			} else {
				printf("\nEsperando...");
			}

		}
	}

	return 0;
}

This compile, but not run...


#include "SDL.h"
#include "stdio.h"


int main(int argc, char *argv[])
{

	unsigned char Guardian;
	unsigned int Tecla;

	SDL_Event event;

	unsigned char Salir;

	Uint8 *keys;


       Salir=0;
	while (Salir<1)
	{

		SDL_PumpEvents();
		keys=SDL_GetKeyState(NULL);

		if (keys[SDLK_UP])
		{
			printf("\nTecla pulsada");
			Salir=1;
		} else {

			printf("\nEsperando...");
		}

	}

	return 0;
}

This compile, but not run...

Is possible what the examples of games are using a old techniques?, not 
valid for the most modern versions of SDL?

Thanks






More information about the SDL mailing list