• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

172 Neutral

About Lightstrike

  • Rank
  1. Is there no SDL input library?

    I think for people that want to get going fairly quick without bothering with input details that would be awesome. I might end up doing it myself too though.
  2. Is there no SDL input library?

    yeah I already made that too for keyboard input using maps. What complicates it is when you want to wrap all types of controllers in this system and make it possible to map any controller movement to any action from any controller in an input options screen. Maybe I'm too ambitious but it was nice to have in our previous directx-based game. That system was based on polling rather than events so rewriting it would be from scratch anyway so I thought maybe someone had made something similar around SDL. I guess at this point the best solution is to start with openinput or ois and build the mapping system on top of it. Or what do you think?
  3. Is there no SDL input library?

    Looks interesting, thanks for the tip. Although it doesn't fit the requiremesnt of extra game features or sdl integration but thats not so important. Just trying to save some dev-time here :)
  4. Is there no SDL input library?

    well I'm already using the sdlevents for keyboard and mouse. thats basics. I'm rather looking for something more high-level similar to ois but with even more features for games like keeping track of different control mappings.
  5. I've been searching The Internet and these forums for a more complete input system for sdl for a couple of hours now and there doesn't seem to exist much more than the basic joystick example tutorials. I found the object oriented input system (ois) but it didn't really seem to do enough or be especially well integrated with SDL as it required directinput to compile. it didn't even have a compiled binary. Here's what I'm looking for: A wrapper library that integrates nicely with SDL apps and gives easy access to input events from keyboard, mouse and multiple joysticks. There are a few keyboard/mouse only ones, I even wrote one myself pretty fast with SDLs event system, but there is nothing more advanced that takes care of joysticks, action->control mappings, sets of controls or provide a unified interface to use in player classes and so on. Basically I'm looking for a more advanced game input library that is easily and ready to use in any sdl-app. Preferably it should be platform-independent/open-source but if its based on sdl events that comes naturally. Surely someone must have built something like this in the open-source/free license world?
  6. Window dimension in world coordinate

    I found this quite useful, mentioned in another old thread. I'm having trouble finding good info on how gluUnProject works though. Because it seems to exaggerate the movements I make with the mouse with the projected coordinates even though I've set up all matrices to work with 1280x720. Vector3 Unproject( int x, int y ) { Vector3 coords; //Something to store our return value in GLfloat wx, wy, wz; //Window coordinates GLdouble cx, cy, cz; //Object coordinates GLdouble mv[16]; //Modelview matrix GLdouble proj[16]; //Projection matrix GLint vp[4]; //Viewport glGetDoublev( GL_MODELVIEW_MATRIX, mv ); glGetDoublev( GL_PROJECTION_MATRIX, proj ); glGetIntegerv( GL_VIEWPORT, vp ); //re-enable various settings we may have turned off glEnable(GL_DEPTH_TEST); //Re-enable depth testing and masking glDepthMask(GL_TRUE); glDepthRange(0.0f,1.0f); wx = ( float ) x; wy = ( float ) vp[3] - ( float ) y; //To invert the y glReadPixels( x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &wz ); gluUnProject( wx, wy, wz, mv, proj, vp, &cx, &cy, &cz ); coords = Vector3( cx, cy, cz ); return coords; }
  7. gluBuild2DMipmaps mess up colors

    true, I thought maybe the fact that it was set to a 0-texture would speed it up. But you're right, I'll make the change.
  8. gluBuild2DMipmaps mess up colors

    short follow up question. Is my solution the faster choice as opposed to doing glDisable on the primitives and glEnable on the textured quad?
  9. gluBuild2DMipmaps mess up colors

    heh spot on. I have a green cell grid :) ah and the last texcoord used for the textured quad applied to all following vertices. a simple glBindTexture(GL_TEXTURE_2D, 0); on all the primitive draw calls did the trick. the opengl doc gave me some trouble. I didn't know what the default texture was. I'm an old directx guy trying to make a new framework for my games based on opengl. Well thanks a lot for your help!
  10. I'm just rendering a few simple primitives (GL_LINES, GL_LINELOOP, GL_QUAD) and a textured quad and it works fine. However if I use gluBuild2DMipmaps everything turns green except the textured quad which renders perfectly. Here's the call to it: gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,(GLsizei)_width,(GLsizei)_height,GL_RGBA,GL_UNSIGNED_BYTE,pSurface->pixels); I normally set color like this before rendering a primitive: glColor4f(red, green, blue, alpha); I tried this: glColor4f(1.0f,1.0f,1.0f,1.0f); glColor4f(red, green, blue, alpha); and this in the initialization code (another old thread suggested it in another situation) glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE); I'd appreciate anyone pointing me in the right direction as to what affects the colors in gluBuild2DMipmaps and how to prevent it.
  11. 2D Physics Engine

    Oh okay. I thought there was some settings in the project too but if that was all it wasn't too bad to convert.
  12. 2D Physics Engine

    Who's got a turtle? Edit: That isn't a GDNET+ member..
  13. 2D Physics Engine

    btw some .cpp files had the _USE_MATH_DEFINES directive in them already so just adding it to the project list didn't work. It was easier to just add a define in cpBody.cpp. How much did you have to change and what from the OSX projects to make it work? It would be good with a list of changes since some may want to just make their existing project "chipmunk-friendly".
  14. 2D Physics Engine

    Hey that sounds great :) Okay I have only used DX before and I now need a OpenGL SDK since VS can't find "GL/glext.h". Seems to be a bunch of different ones out there. Which one should I download? Which one do you use? EDIT: Nevermind. I downloaded glut and the extension headers and linked VS to them and all worked great! Cool demos! Shows the power chipmunk has *already*. [Edited by - Lightstrike on July 25, 2007 3:39:40 PM]
  15. 2D Physics Engine

    I compiled the vc71 project with vs2005 but the constant M_PI was missing causing the only error. Is something missing?
  • Advertisement