--- deliantra/Deliantra-Client/Client.xs 2006/05/21 00:02:01 1.89 +++ deliantra/Deliantra-Client/Client.xs 2006/05/24 01:46:53 1.95 @@ -488,6 +488,9 @@ void SDL_GL_SwapBuffers () +char * +SDL_GetKeyName (int sym) + void SDL_PollEvent () PPCODE: @@ -515,6 +518,8 @@ break; case SDL_MOUSEMOTION: + hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); + hv_store (hv, "state", 5, newSViv (ev.motion.state), 0); hv_store (hv, "x", 1, newSViv (ev.motion.x), 0); hv_store (hv, "y", 1, newSViv (ev.motion.y), 0); @@ -524,6 +529,8 @@ case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: + hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); + hv_store (hv, "button", 6, newSViv (ev.button.button), 0); hv_store (hv, "state", 5, newSViv (ev.button.state), 0); hv_store (hv, "x", 1, newSViv (ev.button.x), 0); @@ -561,6 +568,13 @@ #endif char * +gl_vendor () + CODE: + RETVAL = (char *)glGetString (GL_VENDOR); + OUTPUT: + RETVAL + +char * gl_version () CODE: RETVAL = (char *)glGetString (GL_VERSION); @@ -1085,6 +1099,12 @@ tex->b = b; tex->a = a; } + + // somewhat hackish, but for textures that require it, it really + // improves the look, and most others don't suffer. + glBindTexture (GL_TEXTURE_2D, name); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } int @@ -1637,7 +1657,10 @@ void glLoadIdentity () -# near and far are due to microsofts buggy c compiler +# near_ and far_ are due to microsofts buggy "c" compiler +void glFrustum (double left, double right, double bottom, double top, double near_, double far_) + +# near_ and far_ are due to microsofts buggy "c" compiler void glOrtho (double left, double right, double bottom, double top, double near_, double far_) void glViewport (int x, int y, int width, int height) @@ -1663,6 +1686,7 @@ void glColor (float r, float g, float b, float a = 1.0) PROTOTYPE: @ CODE: + // microsoft visual "c" rounds instead of truncating... glColor4ub (MIN ((int)(r * 255.f), 255), MIN ((int)(g * 255.f), 255), MIN ((int)(b * 255.f), 255), @@ -1674,6 +1698,11 @@ # 1.2 void glDrawRangeElements (int mode, int start, int end +void glRasterPos (float x, float y, float z = 0.) + CODE: + glRasterPos3f (0, 0, z); + glBitmap (0, 0, 0, 0, x, y, 0); + void glVertex (float x, float y, float z = 0.) CODE: glVertex3f (x, y, z); @@ -1710,9 +1739,7 @@ void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) -void glRasterPos (int x, int y) - CODE: - glRasterPos2i (x, y); +void glDrawPixels (int width, int height, int format, int type, char *pixels) void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR)