Skip to content

Commit

Permalink
WIN FIX GL entry points are NULL on windows initially
Browse files Browse the repository at this point in the history
WGL platform leaves the entry points even for core
OpenGL functionality as null until you have a context
and the image wrapper code was assuming it could rely
on the entry point being non-null in deciding whether
to wrap the function.
  • Loading branch information
mcfletch committed Jan 4, 2020
1 parent 57b7706 commit 38edb04
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions OpenGL/GL/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,39 +575,30 @@ def typedImageFunction( suffix, arrayConstant, baseFunction ):
"""Produce a typed version of the given image function"""
functionName = baseFunction.__name__
functionName = '%(functionName)s%(suffix)s'%locals()
if baseFunction:
arrayType = arrays.GL_CONSTANT_TO_ARRAY_TYPE[ arrayConstant ]
function = setDimensionsAsInts(
setImageInput(
baseFunction,
arrayType,
typeName = arrayConstant,
)
arrayType = arrays.GL_CONSTANT_TO_ARRAY_TYPE[ arrayConstant ]
function = setDimensionsAsInts(
setImageInput(
baseFunction,
arrayType,
typeName = arrayConstant,
)
return functionName, function
else:
return functionName, baseFunction
)
return functionName, function

def _setDataSize( baseFunction, argument='imageSize' ):
"""Set the data-size value to come from the data field"""
if baseFunction:
converter = CompressedImageConverter()
return asWrapper( baseFunction ).setPyConverter(
argument
).setCConverter( argument, converter )
else:
return baseFunction
converter = CompressedImageConverter()
return asWrapper( baseFunction ).setPyConverter(
argument
).setCConverter( argument, converter )

def compressedImageFunction( baseFunction ):
"""Set the imageSize and dimensions-as-ints converters for baseFunction"""
if baseFunction:
return setDimensionsAsInts(
_setDataSize(
baseFunction, argument='imageSize'
)
return setDimensionsAsInts(
_setDataSize(
baseFunction, argument='imageSize'
)
else:
return baseFunction
)

for suffix,arrayConstant in [
('b', GL_1_1.GL_BYTE),
Expand Down

0 comments on commit 38edb04

Please sign in to comment.