Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
JokeRe: Public Key Encrytpion with Web Services Pin
Nader Elshehabi24-Sep-06 15:35
Nader Elshehabi24-Sep-06 15:35 
QuestionPorting this to event-based? Pin
Lord Kixdemp24-Sep-06 12:31
Lord Kixdemp24-Sep-06 12:31 
AnswerRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 12:44
Nader Elshehabi24-Sep-06 12:44 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 14:27
Lord Kixdemp24-Sep-06 14:27 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 14:54
Nader Elshehabi24-Sep-06 14:54 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 15:13
Lord Kixdemp24-Sep-06 15:13 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 15:30
Nader Elshehabi24-Sep-06 15:30 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 11:25
Lord Kixdemp25-Sep-06 11:25 
1- Simple DirectMedia Layer is a graphics library, based in OpenGL... Poke tongue | ;-P
2- In my C++ code I did, here:

bool Game::Respond()
{
	// Poll for SDL events
	SDL_Event event;
	while (SDL_PollEvent(&event))
	{
		switch (event.type)
		{
			// Key presses
		case SDL_KEYDOWN:
			switch (event.key.keysym.sym)
			{
				// Arrows
			case SDLK_LEFT:
				this->gLtKey = 1;
				break;
			case SDLK_RIGHT:
				this->gRtKey = 1;
				break;
			case SDLK_UP:
				this->gUpKey = 1;
				break;
			case SDLK_DOWN:
				this->gDnKey = 1;
				break;
				// Press Shift to start running
			case SDLK_LSHIFT:
				this->gRun	 = 1;
				break;
			default:
                break;
			}
			break;

			// Key releases
		case SDL_KEYUP:
			switch (event.key.keysym.sym)
			{
				// Quit key
			case SDLK_ESCAPE:
				exit(0);
				// Arrows
			case SDLK_LEFT:
				this->gLtKey = 0;
				break;
			case SDLK_RIGHT:
				this->gRtKey = 0;
				break;
			case SDLK_UP:
				this->gUpKey = 0;
				break;
			case SDLK_DOWN:
				this->gDnKey = 0;
				break;
			// Release Shift to stop running
			case SDLK_LSHIFT:
				this->gRun	 = 0;
				break;
			default:
                break;
			}
			break;
		case SDL_QUIT:
			exit(0);
		}
	}
}
(There was more after that, but that's the part that matters...)


3- SDL.NET is the C#/.NET port of SDL... It handles events the same way .NET Windows Forms does, with delegates and stuff.

4- Nah, I did it, that's what the code in my first post does. Poke tongue | ;-P

5- See the code I posted in #2? That's what events in SDL looked like...

Sorry for causing such confusion, I'm a n00b! Thanks! Wink | ;)

Windows Calculator told me I will die at 28. Frown | :(

GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 11:44
Nader Elshehabi25-Sep-06 11:44 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 14:27
Lord Kixdemp25-Sep-06 14:27 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 14:36
Nader Elshehabi25-Sep-06 14:36 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 15:02
Lord Kixdemp25-Sep-06 15:02 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 15:31
Nader Elshehabi25-Sep-06 15:31 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp26-Sep-06 14:55
Lord Kixdemp26-Sep-06 14:55 
AnswerRe: Porting this to event-based? Pin
Christian Graus24-Sep-06 15:12
protectorChristian Graus24-Sep-06 15:12 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 15:17
Lord Kixdemp24-Sep-06 15:17 
GeneralRe: Porting this to event-based? Pin
Christian Graus24-Sep-06 15:29
protectorChristian Graus24-Sep-06 15:29 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 8:14
Lord Kixdemp25-Sep-06 8:14 
Questionadd column to dataset Pin
Mohammed Elkholy24-Sep-06 10:39
Mohammed Elkholy24-Sep-06 10:39 
AnswerRe: add column to dataset Pin
Nader Elshehabi24-Sep-06 12:08
Nader Elshehabi24-Sep-06 12:08 
Question[Message Deleted] Pin
code_wiz24-Sep-06 8:06
code_wiz24-Sep-06 8:06 
AnswerRe: extracting a message value from LParam in Message in WndProc(...) Pin
Christian Graus24-Sep-06 11:58
protectorChristian Graus24-Sep-06 11:58 
QuestionRe: extracting a message value from LParam in Message in WndProc(...) Pin
Nader Elshehabi24-Sep-06 12:04
Nader Elshehabi24-Sep-06 12:04 
QuestionProblem getting serial port to open Pin
NYTSX24-Sep-06 7:50
NYTSX24-Sep-06 7:50 
AnswerRe: Problem getting serial port to open Pin
Ed.Poore24-Sep-06 8:23
Ed.Poore24-Sep-06 8:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.