ssgVtxArrary and ssgSimpleList addtions + pui resize additions (was Re: [Plib-devel] Changing VTable
Brought to you by:
sjbaker
From: Sam S. <sa...@sp...> - 2000-08-06 18:17:58
|
Well, obviously I should had been using ssgVxtTable rather than the obsolute ssgVTable - which means the set methods I mentioned need to be a part of ssgSimpleList. In my copy I've added: void raw_set (unsigned int n, char *thing ) { if(n < total) memcpy ( & list [ sizeof * n ], thing, size_of ) ; }; in ssgSimpleList, and equivlent methods in ssgVertexArray, ssgTexCoordArray, ssgNormalArray, ssgColourArray, ie: void set ( unsigned int n , sgVec3 thing ) { raw_set ( n, (char *) thing ) ; } ; in ssgVertexArray. And then in ssgVtxArrary: void setVertex (int i, sgVec3 thing){ if(i<getNumVertices ())vertices ->set(i, thing)} void setNormal (int i, sgVec3 thing){ if(i<getNumNormals ())normals ->set(i, thing)} void setTexCoord(int i, sgVec2 hing){ if(i<getNumTexCoords())texcoords->set(i, thing)} void setColour (int i, sgVec4 thing){ if(i<getNumColours ())colours ->set(i, thing)} If it's liked I'd appreciate this code being added to the CVS version. I've also hacked my copy of pui so that gadget sizes can be specified in opengl co-ordinates, rather than pixels. It's very simple - it uses this code from the non-glut part of pui: static int puWindowWidth = 400 ; static int puWindowHeight = 400 ; int puGetWindowHeight () { return puWindowHeight ; } int puGetWindowWidth () { return puWindowWidth ; } void puSetWindowSize ( int width, int height ) { puWindowWidth = width ; puWindowHeight = height ; } I need this because I use some of the pui gadgets (well actually subclasses of the pui gadgets), to add controls to my HUD (this is also coupled with calling puGetUltimateLiveInterface () -> draw ( 0, 0 ) ; myself rather than calling puDisplay() - as this would cause a redundant glViewport call). If anyone else is interested in this I'll knock up an alteration so that it can be enabled at runtime. Sam |