Update RingOpenGL - Add Function (Source Code) : void glColor4ub(GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)
@@ -818,6 +818,24 @@ RING_FUNC(ring_glColor4d)
glColor4d( (GLdouble ) RING_API_GETNUMBER(1), (GLdouble ) RING_API_GETNUMBER(2), (GLdouble ) RING_API_GETNUMBER(3), (GLdouble ) RING_API_GETNUMBER(4));
}
+
+RING_FUNC(ring_glColor4ub)
+{
+ if ( RING_API_PARACOUNT != 4 ) {
+ RING_API_ERROR(RING_API_MISS4PARA);
+ return ;
+ }
+ glColor4ub(* (GLubyte *) RING_API_GETCPOINTER(1,"GLubyte"),* (GLubyte *) RING_API_GETCPOINTER(2,"GLubyte"),* (GLubyte *) RING_API_GETCPOINTER(3,"GLubyte"),* (GLubyte *) RING_API_GETCPOINTER(4,"GLubyte"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(1))
+ free(RING_API_GETCPOINTER(1,"GLubyte"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(2))
+ free(RING_API_GETCPOINTER(2,"GLubyte"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(3))
+ free(RING_API_GETCPOINTER(3,"GLubyte"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(4))
+ free(RING_API_GETCPOINTER(4,"GLubyte"));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("glaccum",ring_glAccum);
@@ -862,4 +880,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("glcolor4i",ring_glColor4i);
ring_vm_funcregister("glcolor4f",ring_glColor4f);
ring_vm_funcregister("glcolor4d",ring_glColor4d);
+ ring_vm_funcregister("glcolor4ub",ring_glColor4ub);
}
