diff --git a/OpenGL/raw/GLUT/__init__.py b/OpenGL/raw/GLUT/__init__.py index ca3344ab..47831f0c 100644 --- a/OpenGL/raw/GLUT/__init__.py +++ b/OpenGL/raw/GLUT/__init__.py @@ -6,6 +6,7 @@ from OpenGL.raw.GLUT.constants import * from ctypes import * +from OpenGL._bytes import unicode from OpenGL import platform, arrays from OpenGL.constant import Constant from OpenGL import constants as GLconstants @@ -17,7 +18,12 @@ else: CALLBACK_FUNCTION_TYPE = platform.PLATFORM.functionTypeFor( platform.GLUT ) -STRING = c_char_p +class STRING( c_char_p ): + @classmethod + def from_param( cls, value ): + if isinstance( value, unicode ): + value = value.encode( 'utf-8' ) + return super( STRING, cls ).from_param( value ) from OpenGL.constants import GLenum from OpenGL.constants import GLfloat from OpenGL.constants import GLdouble