import sys
from mock import Mock

__all__ = ["modules"]


class MockBase:
    def __new__(self, *args, **kwargs):
        return super().__new__(self)

    @classmethod
    def factory(cls, name, attrs=None):
        return type(name, (MockBase,), attrs or {})

bgl = ['Buffer', 'GL_2D', 'GL_2_BYTES',
        'GL_3D', 'GL_3D_COLOR', 'GL_3D_COLOR_TEXTURE',
        'GL_3_BYTES', 'GL_4D_COLOR_TEXTURE', 'GL_4_BYTES',
        'GL_ACCUM', 'GL_ACCUM_ALPHA_BITS', 'GL_ACCUM_BLUE_BITS',
        'GL_ACCUM_BUFFER_BIT', 'GL_ACCUM_CLEAR_VALUE', 'GL_ACCUM_GREEN_BITS',
        'GL_ACCUM_RED_BITS', 'GL_ACTIVE_TEXTURE', 'GL_ADD',
        'GL_ALL_ATTRIB_BITS', 'GL_ALPHA', 'GL_ALPHA_BIAS',
        'GL_ALPHA_BITS', 'GL_ALPHA_SCALE', 'GL_ALPHA_TEST',
        'GL_ALPHA_TEST_FUNC', 'GL_ALPHA_TEST_REF', 'GL_ALWAYS',
        'GL_AMBIENT', 'GL_AMBIENT_AND_DIFFUSE', 'GL_AND',
        'GL_AND_INVERTED', 'GL_AND_REVERSE', 'GL_ATTRIB_STACK_DEPTH',
        'GL_AUTO_NORMAL', 'GL_AUX0', 'GL_AUX1',
        'GL_AUX2', 'GL_AUX3', 'GL_AUX_BUFFERS',
        'GL_BACK', 'GL_BACK_LEFT', 'GL_BACK_RIGHT',
        'GL_BITMAP', 'GL_BITMAP_TOKEN', 'GL_BLEND',
        'GL_BLEND_DST', 'GL_BLEND_SRC', 'GL_BLUE',
        'GL_BLUE_BIAS', 'GL_BLUE_BITS', 'GL_BLUE_SCALE',
        'GL_BYTE', 'GL_CCW', 'GL_CLAMP',
        'GL_CLEAR', 'GL_CLIENT_ALL_ATTRIB_BITS', 'GL_CLIP_PLANE0',
        'GL_CLIP_PLANE1', 'GL_CLIP_PLANE2', 'GL_CLIP_PLANE3',
        'GL_CLIP_PLANE4', 'GL_CLIP_PLANE5', 'GL_COEFF',
        'GL_COLOR', 'GL_COLOR_BUFFER_BIT', 'GL_COLOR_CLEAR_VALUE',
        'GL_COLOR_INDEX', 'GL_COLOR_INDEXES', 'GL_COLOR_MATERIAL',
        'GL_COLOR_MATERIAL_FACE', 'GL_COLOR_MATERIAL_PARAMETER', 'GL_COLOR_WRITEMASK',
        'GL_COMPILE', 'GL_COMPILE_AND_EXECUTE', 'GL_COMPILE_STATUS',
        'GL_CONSTANT_ATTENUATION', 'GL_COPY', 'GL_COPY_INVERTED',
        'GL_COPY_PIXEL_TOKEN', 'GL_CULL_FACE', 'GL_CULL_FACE_MODE',
        'GL_CURRENT_BIT', 'GL_CURRENT_COLOR', 'GL_CURRENT_INDEX',
        'GL_CURRENT_NORMAL', 'GL_CURRENT_RASTER_COLOR', 'GL_CURRENT_RASTER_DISTANCE',
        'GL_CURRENT_RASTER_INDEX', 'GL_CURRENT_RASTER_POSITION', 'GL_CURRENT_RASTER_POSITION_VALID',
        'GL_CURRENT_RASTER_TEXTURE_COORDS', 'GL_CURRENT_TEXTURE_COORDS', 'GL_CW',
        'GL_DECAL', 'GL_DECR', 'GL_DEPTH',
        'GL_DEPTH_BIAS', 'GL_DEPTH_BITS', 'GL_DEPTH_BUFFER_BIT',
        'GL_DEPTH_CLEAR_VALUE', 'GL_DEPTH_COMPONENT', 'GL_DEPTH_COMPONENT32',
        'GL_DEPTH_FUNC', 'GL_DEPTH_RANGE', 'GL_DEPTH_SCALE',
        'GL_DEPTH_TEST', 'GL_DEPTH_WRITEMASK', 'GL_DIFFUSE',
        'GL_DITHER', 'GL_DOMAIN', 'GL_DONT_CARE',
        'GL_DOUBLE', 'GL_DOUBLEBUFFER', 'GL_DRAW_BUFFER',
        'GL_DRAW_PIXEL_TOKEN', 'GL_DST_ALPHA', 'GL_DST_COLOR',
        'GL_EDGE_FLAG', 'GL_EMISSION', 'GL_ENABLE_BIT',
        'GL_EQUAL', 'GL_EQUIV', 'GL_EVAL_BIT',
        'GL_EXP', 'GL_EXP2', 'GL_EXTENSIONS',
        'GL_EYE_LINEAR', 'GL_EYE_PLANE', 'GL_FALSE',
        'GL_FASTEST', 'GL_FEEDBACK', 'GL_FILL',
        'GL_FLAT', 'GL_FLOAT', 'GL_FOG',
        'GL_FOG_BIT', 'GL_FOG_COLOR', 'GL_FOG_DENSITY',
        'GL_FOG_END', 'GL_FOG_HINT', 'GL_FOG_INDEX',
        'GL_FOG_MODE', 'GL_FOG_START', 'GL_FRAGMENT_SHADER',
        'GL_FRONT', 'GL_FRONT_AND_BACK', 'GL_FRONT_FACE',
        'GL_FRONT_LEFT', 'GL_FRONT_RIGHT', 'GL_GEQUAL',
        'GL_GREATER', 'GL_GREEN', 'GL_GREEN_BIAS',
        'GL_GREEN_BITS', 'GL_GREEN_SCALE', 'GL_HINT_BIT',
        'GL_INCR', 'GL_INDEX_BITS', 'GL_INDEX_CLEAR_VALUE',
        'GL_INDEX_MODE', 'GL_INDEX_OFFSET', 'GL_INDEX_SHIFT',
        'GL_INDEX_WRITEMASK', 'GL_INT', 'GL_INVALID_ENUM',
        'GL_INVALID_OPERATION', 'GL_INVALID_VALUE', 'GL_INVERT',
        'GL_KEEP', 'GL_LEFT', 'GL_LEQUAL',
        'GL_LESS', 'GL_LIGHT0', 'GL_LIGHT1',
        'GL_LIGHT2', 'GL_LIGHT3', 'GL_LIGHT4',
        'GL_LIGHT5', 'GL_LIGHT6', 'GL_LIGHT7',
        'GL_LIGHTING', 'GL_LIGHTING_BIT', 'GL_LIGHT_MODEL_AMBIENT',
        'GL_LIGHT_MODEL_LOCAL_VIEWER', 'GL_LIGHT_MODEL_TWO_SIDE', 'GL_LINE',
        'GL_LINEAR', 'GL_LINEAR_ATTENUATION', 'GL_LINEAR_MIPMAP_LINEAR',
        'GL_LINEAR_MIPMAP_NEAREST', 'GL_LINES', 'GL_LINE_BIT',
        'GL_LINE_LOOP', 'GL_LINE_RESET_TOKEN', 'GL_LINE_SMOOTH',
        'GL_LINE_SMOOTH_HINT', 'GL_LINE_STIPPLE', 'GL_LINE_STIPPLE_PATTERN',
        'GL_LINE_STIPPLE_REPEAT', 'GL_LINE_STRIP', 'GL_LINE_TOKEN',
        'GL_LINE_WIDTH', 'GL_LINE_WIDTH_GRANULARITY', 'GL_LINE_WIDTH_RANGE',
        'GL_LIST_BASE', 'GL_LIST_BIT', 'GL_LIST_INDEX',
        'GL_LIST_MODE', 'GL_LOAD', 'GL_LOGIC_OP',
        'GL_LOGIC_OP_MODE', 'GL_LUMINANCE', 'GL_LUMINANCE_ALPHA',
        'GL_MAP1_COLOR_4', 'GL_MAP1_GRID_DOMAIN', 'GL_MAP1_GRID_SEGMENTS',
        'GL_MAP1_INDEX', 'GL_MAP1_NORMAL', 'GL_MAP1_TEXTURE_COORD_1',
        'GL_MAP1_TEXTURE_COORD_2', 'GL_MAP1_TEXTURE_COORD_3', 'GL_MAP1_TEXTURE_COORD_4',
        'GL_MAP1_VERTEX_3', 'GL_MAP1_VERTEX_4', 'GL_MAP2_COLOR_4',
        'GL_MAP2_GRID_DOMAIN', 'GL_MAP2_GRID_SEGMENTS', 'GL_MAP2_INDEX',
        'GL_MAP2_NORMAL', 'GL_MAP2_TEXTURE_COORD_1', 'GL_MAP2_TEXTURE_COORD_2',
        'GL_MAP2_TEXTURE_COORD_3', 'GL_MAP2_TEXTURE_COORD_4', 'GL_MAP2_VERTEX_3',
        'GL_MAP2_VERTEX_4', 'GL_MAP_COLOR', 'GL_MAP_STENCIL',
        'GL_MATRIX_MODE', 'GL_MAX_ATTRIB_STACK_DEPTH', 'GL_MAX_CLIP_PLANES',
        'GL_MAX_EVAL_ORDER', 'GL_MAX_LIGHTS', 'GL_MAX_LIST_NESTING',
        'GL_MAX_MODELVIEW_STACK_DEPTH', 'GL_MAX_NAME_STACK_DEPTH', 'GL_MAX_PIXEL_MAP_TABLE',
        'GL_MAX_PROJECTION_STACK_DEPTH', 'GL_MAX_TEXTURE_SIZE', 'GL_MAX_TEXTURE_STACK_DEPTH',
        'GL_MAX_VIEWPORT_DIMS', 'GL_MODELVIEW', 'GL_MODELVIEW_MATRIX',
        'GL_MODELVIEW_STACK_DEPTH', 'GL_MODULATE', 'GL_MULT',
        'GL_NAME_STACK_DEPTH', 'GL_NAND', 'GL_NEAREST',
        'GL_NEAREST_MIPMAP_LINEAR', 'GL_NEAREST_MIPMAP_NEAREST', 'GL_NEVER',
        'GL_NICEST', 'GL_NONE', 'GL_NOOP',
        'GL_NOR', 'GL_NORMALIZE', 'GL_NOTEQUAL',
        'GL_NO_ERROR', 'GL_OBJECT_LINEAR', 'GL_OBJECT_PLANE',
        'GL_ONE', 'GL_ONE_MINUS_DST_ALPHA', 'GL_ONE_MINUS_DST_COLOR',
        'GL_ONE_MINUS_SRC_ALPHA', 'GL_ONE_MINUS_SRC_COLOR', 'GL_OR',
        'GL_ORDER', 'GL_OR_INVERTED', 'GL_OR_REVERSE',
        'GL_OUT_OF_MEMORY', 'GL_PACK_ALIGNMENT', 'GL_PACK_LSB_FIRST',
        'GL_PACK_ROW_LENGTH', 'GL_PACK_SKIP_PIXELS', 'GL_PACK_SKIP_ROWS',
        'GL_PACK_SWAP_BYTES', 'GL_PASS_THROUGH_TOKEN', 'GL_PERSPECTIVE_CORRECTION_HINT',
        'GL_PIXEL_MAP_A_TO_A', 'GL_PIXEL_MAP_A_TO_A_SIZE', 'GL_PIXEL_MAP_B_TO_B',
        'GL_PIXEL_MAP_B_TO_B_SIZE', 'GL_PIXEL_MAP_G_TO_G', 'GL_PIXEL_MAP_G_TO_G_SIZE',
        'GL_PIXEL_MAP_I_TO_A', 'GL_PIXEL_MAP_I_TO_A_SIZE', 'GL_PIXEL_MAP_I_TO_B',
        'GL_PIXEL_MAP_I_TO_B_SIZE', 'GL_PIXEL_MAP_I_TO_G', 'GL_PIXEL_MAP_I_TO_G_SIZE',
        'GL_PIXEL_MAP_I_TO_I', 'GL_PIXEL_MAP_I_TO_I_SIZE', 'GL_PIXEL_MAP_I_TO_R',
        'GL_PIXEL_MAP_I_TO_R_SIZE', 'GL_PIXEL_MAP_R_TO_R', 'GL_PIXEL_MAP_R_TO_R_SIZE',
        'GL_PIXEL_MAP_S_TO_S', 'GL_PIXEL_MAP_S_TO_S_SIZE', 'GL_PIXEL_MODE_BIT',
        'GL_POINT', 'GL_POINTS', 'GL_POINT_BIT',
        'GL_POINT_SIZE', 'GL_POINT_SIZE_GRANULARITY', 'GL_POINT_SIZE_RANGE',
        'GL_POINT_SMOOTH', 'GL_POINT_SMOOTH_HINT', 'GL_POINT_TOKEN',
        'GL_POLYGON', 'GL_POLYGON_BIT', 'GL_POLYGON_MODE',
        'GL_POLYGON_OFFSET_FACTOR', 'GL_POLYGON_OFFSET_FILL', 'GL_POLYGON_OFFSET_LINE',
        'GL_POLYGON_OFFSET_POINT', 'GL_POLYGON_OFFSET_UNITS', 'GL_POLYGON_SMOOTH',
        'GL_POLYGON_SMOOTH_HINT', 'GL_POLYGON_STIPPLE', 'GL_POLYGON_STIPPLE_BIT',
        'GL_POLYGON_TOKEN', 'GL_POSITION', 'GL_PROJECTION',
        'GL_PROJECTION_MATRIX', 'GL_PROJECTION_STACK_DEPTH', 'GL_Q',
        'GL_QUADRATIC_ATTENUATION', 'GL_QUADS', 'GL_QUAD_STRIP',
        'GL_R', 'GL_READ_BUFFER', 'GL_RED',
        'GL_RED_BIAS', 'GL_RED_BITS', 'GL_RED_SCALE',
        'GL_RENDER', 'GL_RENDERER', 'GL_RENDER_MODE',
        'GL_REPEAT', 'GL_REPLACE', 'GL_RETURN',
        'GL_RGB', 'GL_RGBA', 'GL_RGBA_MODE',
        'GL_RIGHT', 'GL_S', 'GL_SCISSOR_BIT',
        'GL_SCISSOR_BOX', 'GL_SCISSOR_TEST', 'GL_SELECT',
        'GL_SET', 'GL_SHADE_MODEL', 'GL_SHININESS',
        'GL_SHORT', 'GL_SMOOTH', 'GL_SPECULAR',
        'GL_SPHERE_MAP', 'GL_SPOT_CUTOFF', 'GL_SPOT_DIRECTION',
        'GL_SPOT_EXPONENT', 'GL_SRC_ALPHA', 'GL_SRC_ALPHA_SATURATE',
        'GL_SRC_COLOR', 'GL_STACK_OVERFLOW', 'GL_STACK_UNDERFLOW',
        'GL_STENCIL', 'GL_STENCIL_BITS', 'GL_STENCIL_BUFFER_BIT',
        'GL_STENCIL_CLEAR_VALUE', 'GL_STENCIL_FAIL', 'GL_STENCIL_FUNC',
        'GL_STENCIL_INDEX', 'GL_STENCIL_PASS_DEPTH_FAIL', 'GL_STENCIL_PASS_DEPTH_PASS',
        'GL_STENCIL_REF', 'GL_STENCIL_TEST', 'GL_STENCIL_VALUE_MASK',
        'GL_STENCIL_WRITEMASK', 'GL_STEREO', 'GL_SUBPIXEL_BITS',
        'GL_T', 'GL_TEXTURE', 'GL_TEXTURE0',
        'GL_TEXTURE1', 'GL_TEXTURE2', 'GL_TEXTURE3',
        'GL_TEXTURE4', 'GL_TEXTURE5', 'GL_TEXTURE6',
        'GL_TEXTURE7', 'GL_TEXTURE8', 'GL_TEXTURE_1D',
        'GL_TEXTURE_2D', 'GL_TEXTURE_BINDING_1D', 'GL_TEXTURE_BINDING_2D',
        'GL_TEXTURE_BIT', 'GL_TEXTURE_BORDER', 'GL_TEXTURE_BORDER_COLOR',
        'GL_TEXTURE_COMPARE_MODE', 'GL_TEXTURE_COMPONENTS', 'GL_TEXTURE_ENV',
        'GL_TEXTURE_ENV_COLOR', 'GL_TEXTURE_ENV_MODE', 'GL_TEXTURE_GEN_MODE',
        'GL_TEXTURE_GEN_Q', 'GL_TEXTURE_GEN_R', 'GL_TEXTURE_GEN_S',
        'GL_TEXTURE_GEN_T', 'GL_TEXTURE_HEIGHT', 'GL_TEXTURE_MAG_FILTER',
        'GL_TEXTURE_MATRIX', 'GL_TEXTURE_MIN_FILTER', 'GL_TEXTURE_PRIORITY',
        'GL_TEXTURE_RESIDENT', 'GL_TEXTURE_STACK_DEPTH', 'GL_TEXTURE_WIDTH',
        'GL_TEXTURE_WRAP_S', 'GL_TEXTURE_WRAP_T', 'GL_TRANSFORM_BIT',
        'GL_TRIANGLES', 'GL_TRIANGLE_FAN', 'GL_TRIANGLE_STRIP',
        'GL_TRUE', 'GL_UNPACK_ALIGNMENT', 'GL_UNPACK_LSB_FIRST',
        'GL_UNPACK_ROW_LENGTH', 'GL_UNPACK_SKIP_PIXELS', 'GL_UNPACK_SKIP_ROWS',
        'GL_UNPACK_SWAP_BYTES', 'GL_UNSIGNED_BYTE', 'GL_UNSIGNED_INT',
        'GL_UNSIGNED_SHORT', 'GL_VENDOR', 'GL_VERSION',
        'GL_VERTEX_SHADER', 'GL_VIEWPORT', 'GL_VIEWPORT_BIT',
        'GL_XOR', 'GL_ZERO', 'GL_ZOOM_X',
        'GL_ZOOM_Y', '__doc__', '__loader__',
        '__name__', '__package__', 'glAccum',
        'glActiveTexture', 'glAlphaFunc', 'glAreTexturesResident',
        'glAttachShader', 'glBegin', 'glBindTexture',
        'glBitmap', 'glBlendFunc', 'glCallList',
        'glCallLists', 'glClear', 'glClearAccum',
        'glClearColor', 'glClearDepth', 'glClearIndex',
        'glClearStencil', 'glClipPlane', 'glColor3b',
        'glColor3bv', 'glColor3d', 'glColor3dv',
        'glColor3f', 'glColor3fv', 'glColor3i',
        'glColor3iv', 'glColor3s', 'glColor3sv',
        'glColor3ub', 'glColor3ubv', 'glColor3ui',
        'glColor3uiv', 'glColor3us', 'glColor3usv',
        'glColor4b', 'glColor4bv', 'glColor4d',
        'glColor4dv', 'glColor4f', 'glColor4fv',
        'glColor4i', 'glColor4iv', 'glColor4s',
        'glColor4sv', 'glColor4ub', 'glColor4ubv',
        'glColor4ui', 'glColor4uiv', 'glColor4us',
        'glColor4usv', 'glColorMask', 'glColorMaterial',
        'glCompileShader', 'glCopyPixels', 'glCopyTexImage2D',
        'glCreateProgram', 'glCreateShader', 'glCullFace',
        'glDeleteLists', 'glDeleteProgram', 'glDeleteShader',
        'glDeleteTextures', 'glDepthFunc', 'glDepthMask',
        'glDepthRange', 'glDetachShader', 'glDisable',
        'glDrawBuffer', 'glDrawPixels', 'glEdgeFlag',
        'glEdgeFlagv', 'glEnable', 'glEnd',
        'glEndList', 'glEvalCoord1d', 'glEvalCoord1dv',
        'glEvalCoord1f', 'glEvalCoord1fv', 'glEvalCoord2d',
        'glEvalCoord2dv', 'glEvalCoord2f', 'glEvalCoord2fv',
        'glEvalMesh1', 'glEvalMesh2', 'glEvalPoint1',
        'glEvalPoint2', 'glFeedbackBuffer', 'glFinish',
        'glFlush', 'glFogf', 'glFogfv',
        'glFogi', 'glFogiv', 'glFrontFace',
        'glFrustum', 'glGenLists', 'glGenTextures',
        'glGetAttachedShaders', 'glGetBooleanv', 'glGetClipPlane',
        'glGetDoublev', 'glGetError', 'glGetFloatv',
        'glGetIntegerv', 'glGetLightfv', 'glGetLightiv',
        'glGetMapdv', 'glGetMapfv', 'glGetMapiv',
        'glGetMaterialfv', 'glGetMaterialiv', 'glGetPixelMapfv',
        'glGetPixelMapuiv', 'glGetPixelMapusv', 'glGetPolygonStipple',
        'glGetProgramInfoLog', 'glGetProgramiv', 'glGetShaderInfoLog',
        'glGetShaderSource', 'glGetShaderiv', 'glGetString',
        'glGetTexEnvfv', 'glGetTexEnviv', 'glGetTexGendv',
        'glGetTexGenfv', 'glGetTexGeniv', 'glGetTexImage',
        'glGetTexLevelParameterfv', 'glGetTexLevelParameteriv', 'glGetTexParameterfv',
        'glGetTexParameteriv', 'glGetUniformLocation', 'glHint',
        'glIndexMask', 'glIndexd', 'glIndexdv',
        'glIndexf', 'glIndexfv', 'glIndexi',
        'glIndexiv', 'glIndexs', 'glIndexsv',
        'glInitNames', 'glIsEnabled', 'glIsList',
        'glIsProgram', 'glIsShader', 'glIsTexture',
        'glLightModelf', 'glLightModelfv', 'glLightModeli',
        'glLightModeliv', 'glLightf', 'glLightfv',
        'glLighti', 'glLightiv', 'glLineStipple',
        'glLineWidth', 'glLinkProgram', 'glListBase',
        'glLoadIdentity', 'glLoadMatrixd', 'glLoadMatrixf',
        'glLoadName', 'glLogicOp', 'glMap1d',
        'glMap1f', 'glMap2d', 'glMap2f',
        'glMapGrid1d', 'glMapGrid1f', 'glMapGrid2d',
        'glMapGrid2f', 'glMaterialf', 'glMaterialfv',
        'glMateriali', 'glMaterialiv', 'glMatrixMode',
        'glMultMatrixd', 'glMultMatrixf', 'glNewList',
        'glNormal3b', 'glNormal3bv', 'glNormal3d',
        'glNormal3dv', 'glNormal3f', 'glNormal3fv',
        'glNormal3i', 'glNormal3iv', 'glNormal3s',
        'glNormal3sv', 'glOrtho', 'glPassThrough',
        'glPixelMapfv', 'glPixelMapuiv', 'glPixelMapusv',
        'glPixelStoref', 'glPixelStorei', 'glPixelTransferf',
        'glPixelTransferi', 'glPixelZoom', 'glPointSize',
        'glPolygonMode', 'glPolygonOffset', 'glPolygonStipple',
        'glPopAttrib', 'glPopClientAttrib', 'glPopMatrix',
        'glPopName', 'glPrioritizeTextures', 'glPushAttrib',
        'glPushClientAttrib', 'glPushMatrix', 'glPushName',
        'glRasterPos2d', 'glRasterPos2dv', 'glRasterPos2f',
        'glRasterPos2fv', 'glRasterPos2i', 'glRasterPos2iv',
        'glRasterPos2s', 'glRasterPos2sv', 'glRasterPos3d',
        'glRasterPos3dv', 'glRasterPos3f', 'glRasterPos3fv',
        'glRasterPos3i', 'glRasterPos3iv', 'glRasterPos3s',
        'glRasterPos3sv', 'glRasterPos4d', 'glRasterPos4dv',
        'glRasterPos4f', 'glRasterPos4fv', 'glRasterPos4i',
        'glRasterPos4iv', 'glRasterPos4s', 'glRasterPos4sv',
        'glReadBuffer', 'glReadPixels', 'glRectd',
        'glRectdv', 'glRectf', 'glRectfv',
        'glRecti', 'glRectiv', 'glRects',
        'glRectsv', 'glRenderMode', 'glRotated',
        'glRotatef', 'glScaled', 'glScalef',
        'glScissor', 'glSelectBuffer', 'glShadeModel',
        'glShaderSource', 'glStencilFunc', 'glStencilMask',
        'glStencilOp', 'glTexCoord1d', 'glTexCoord1dv',
        'glTexCoord1f', 'glTexCoord1fv', 'glTexCoord1i',
        'glTexCoord1iv', 'glTexCoord1s', 'glTexCoord1sv',
        'glTexCoord2d', 'glTexCoord2dv', 'glTexCoord2f',
        'glTexCoord2fv', 'glTexCoord2i', 'glTexCoord2iv',
        'glTexCoord2s', 'glTexCoord2sv', 'glTexCoord3d',
        'glTexCoord3dv', 'glTexCoord3f', 'glTexCoord3fv',
        'glTexCoord3i', 'glTexCoord3iv', 'glTexCoord3s',
        'glTexCoord3sv', 'glTexCoord4d', 'glTexCoord4dv',
        'glTexCoord4f', 'glTexCoord4fv', 'glTexCoord4i',
        'glTexCoord4iv', 'glTexCoord4s', 'glTexCoord4sv',
        'glTexEnvf', 'glTexEnvfv', 'glTexEnvi',
        'glTexEnviv', 'glTexGend', 'glTexGendv',
        'glTexGenf', 'glTexGenfv', 'glTexGeni',
        'glTexGeniv', 'glTexImage1D', 'glTexImage2D',
        'glTexParameterf', 'glTexParameterfv', 'glTexParameteri',
        'glTexParameteriv', 'glTranslated', 'glTranslatef',
        'glUniform1f', 'glUniform1fv', 'glUniform1i',
        'glUniform1iv', 'glUniform2f', 'glUniform2fv',
        'glUniform2i', 'glUniform2iv', 'glUniform3f',
        'glUniform3fv', 'glUniform3i', 'glUniform3iv',
        'glUniform4f', 'glUniform4fv', 'glUniform4i',
        'glUniform4iv', 'glUniformMatrix2fv', 'glUniformMatrix2x3fv',
        'glUniformMatrix2x4fv', 'glUniformMatrix3fv', 'glUniformMatrix3x2fv',
        'glUniformMatrix3x4fv', 'glUniformMatrix4fv', 'glUniformMatrix4x2fv',
        'glUniformMatrix4x3fv', 'glUseProgram', 'glValidateProgram',
        'glVertex2d', 'glVertex2dv', 'glVertex2f',
        'glVertex2fv', 'glVertex2i', 'glVertex2iv',
        'glVertex2s', 'glVertex2sv', 'glVertex3d',
        'glVertex3dv', 'glVertex3f', 'glVertex3fv',
        'glVertex3i', 'glVertex3iv', 'glVertex3s',
        'glVertex3sv', 'glVertex4d', 'glVertex4dv',
        'glVertex4f', 'glVertex4fv', 'glVertex4i',
        'glVertex4iv', 'glVertex4s', 'glVertex4sv',
        'glViewport', 'gluLookAt', 'gluOrtho2D',
        'gluPerspective', 'gluPickMatrix', 'gluProject',
        'gluUnProject']

ge_types = MockBase.factory("types", dict(KX_PythonLogicLoop=MockBase.factory("LogicLoop"),
                                          KX_GameObject=MockBase.factory("KX_GameObject")))
ge_events = type("", (), {})()
ge_logic = dict(types=ge_types, events=ge_events)
mathutils = dict(Vector=MockBase.factory("Vector"),
                 Euler=MockBase.factory("Euler"),
                 Quaternion=MockBase.factory("Quaternion"),
                 geometry=Mock(name="Geometry"))

modules = [("bge", ge_logic), ("mathutils", mathutils),
            "aud", ("bgl", {x: Mock() for x in bgl}), "blf",
            "opus", "pyaudio"]


for module_name in modules:
    if not isinstance(module_name, str):
        module_name, attributes = module_name
    else:
        attributes = {}

    try:
        __import__(module_name)

    except ImportError:
        mock = Mock(name=module_name)
        sys.modules[module_name] = mock

        mock.configure_mock(**attributes)

        print("Faking needed import {}".format(module_name))

