Mouse moving left or right (relatively speaking)

I am learning OpenGL and picked SDL for my event/sound etc library. I’m
really impressed with it. I am having a problem though. I can’t seem
to figure out exactly what I need to do to determine if I have moved the
mouse left or right relative to the screen. I made a very simple 3D
world (floor and sky) and can move about with the keyboard just fine.
But I would like to control the view with my mouse. Similar to all
those oh so familiar 3D shooter games.

So basically I need to remove my events for the LEFT and RIGHT key
events and call methods accordingly when the mouse is moving left or
right. Any help would be great.

Thanks.

Gregg

Using the SDL_MouseMotionEvent (
http://sdldoc.csn.ul.ie/sdlmousemotionevent.php ) you can get
the current, and relative coordinates of the mouse.

— Gregg Bolinger wrote:> I am learning OpenGL and picked SDL for my event/sound etc

library. I’m
really impressed with it. I am having a problem though. I
can’t seem
to figure out exactly what I need to do to determine if I have
moved the
mouse left or right relative to the screen. I made a very
simple 3D
world (floor and sky) and can move about with the keyboard
just fine.
But I would like to control the view with my mouse. Similar
to all
those oh so familiar 3D shooter games.

So basically I need to remove my events for the LEFT and RIGHT
key
events and call methods accordingly when the mouse is moving
left or
right. Any help would be great.

Thanks.

Gregg


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.

Using the SDL_MouseMotionEvent (
http://sdldoc.csn.ul.ie/sdlmousemotionevent.php ) you can get
the current, and relative coordinates of the mouse.

This will give you 2d movements of the mouse, but you want 3d. Check
out this tutorial from gametutorials on how to do this:

http://www.gametutorials.com/download/Ports/OpenGL/TimeBasedMovement_SDL.zip

It shows you how to use a combination of keyboard + mouse to have quake
like movements in a game.

Mark DillavouOn Thu, 2004-06-10 at 15:40, jake b wrote:

— Gregg Bolinger wrote:

I am learning OpenGL and picked SDL for my event/sound etc
library. I’m
really impressed with it. I am having a problem though. I
can’t seem
to figure out exactly what I need to do to determine if I have
moved the
mouse left or right relative to the screen. I made a very
simple 3D
world (floor and sky) and can move about with the keyboard
just fine.
But I would like to control the view with my mouse. Similar
to all
those oh so familiar 3D shooter games.

So basically I need to remove my events for the LEFT and RIGHT
key
events and call methods accordingly when the mouse is moving
left or
right. Any help would be great.

Thanks.

Gregg


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl