Skip to content

Commit

Permalink
Fixed access violation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aermoss committed Aug 25, 2024
1 parent 31ca97a commit 287e1a3
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion sdl3/SDL_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SDL_AudioSpec(ctypes.Structure):

SDL_AUDIO_FRAMESIZE = lambda x: SDL_AUDIO_BYTESIZE(x.format) * x.channels

class SDL_AudioStream(ctypes.Structure):
class SDL_AudioStream(ctypes.c_void_p):
...

SDL_FUNC("SDL_GetNumAudioDrivers", ctypes.c_int)
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

SDL_CameraID = ctypes.c_uint32

class SDL_Camera(ctypes.Structure):
class SDL_Camera(ctypes.c_void_p):
...

class SDL_CameraSpec(ctypes.Structure):
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_gamepad.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_Gamepad(ctypes.Structure):
class SDL_Gamepad(ctypes.c_void_p):
...

SDL_GamepadType = ctypes.c_int
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_haptic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_Haptic(ctypes.Structure):
class SDL_Haptic(ctypes.c_void_p):
...

SDL_HAPTIC_CONSTANT = 1 << 0
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_hidapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_hid_device(ctypes.Structure):
class SDL_hid_device(ctypes.c_void_p):
...

SDL_hid_bus_type = ctypes.c_int
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SDL_IOStreamInterface(ctypes.Structure):
("close", ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p))
]

class SDL_IOStream(ctypes.Structure):
class SDL_IOStream(ctypes.c_void_p):
...

SDL_FUNC("SDL_IOFromFile", ctypes.POINTER(SDL_IOStream), ctypes.c_char_p, ctypes.c_char_p)
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_joystick.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_Joystick(ctypes.Structure):
class SDL_Joystick(ctypes.c_void_p):
...

SDL_JoystickID = ctypes.c_uint32
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Mix_Chunk(ctypes.Structure):
MUS_WAVPACK = 11
MUS_GME = 12

class Mix_Music(ctypes.Structure):
class Mix_Music(ctypes.c_void_p):
...

SDL_FUNC("Mix_OpenAudio", ctypes.c_int, SDL_AudioDeviceID, ctypes.POINTER(SDL_AudioSpec))
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

SDL_MouseID = ctypes.c_uint32

class SDL_Cursor(ctypes.Structure):
class SDL_Cursor(ctypes.c_void_p):
...

SDL_SystemCursor = ctypes.c_int
Expand Down
8 changes: 4 additions & 4 deletions sdl3/SDL_mutex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SDL_MUTEX_TIMEDOUT = 1

class SDL_Mutex(ctypes.Structure):
class SDL_Mutex(ctypes.c_void_p):
...

SDL_FUNC("SDL_CreateMutex", ctypes.POINTER(SDL_Mutex))
Expand All @@ -14,7 +14,7 @@ class SDL_Mutex(ctypes.Structure):
SDL_FUNC("SDL_UnlockMutex", None, ctypes.POINTER(SDL_Mutex))
SDL_FUNC("SDL_DestroyMutex", None, ctypes.POINTER(SDL_Mutex))

class SDL_RWLock(ctypes.Structure):
class SDL_RWLock(ctypes.c_void_p):
...

SDL_RWLOCK_TIMEDOUT = SDL_MUTEX_TIMEDOUT
Expand All @@ -27,7 +27,7 @@ class SDL_RWLock(ctypes.Structure):
SDL_FUNC("SDL_UnlockRWLock", None, ctypes.POINTER(SDL_RWLock))
SDL_FUNC("SDL_DestroyRWLock", None, ctypes.POINTER(SDL_RWLock))

class SDL_Semaphore(ctypes.Structure):
class SDL_Semaphore(ctypes.c_void_p):
...

SDL_FUNC("SDL_CreateSemaphore", ctypes.POINTER(SDL_Semaphore), ctypes.c_uint32)
Expand All @@ -38,7 +38,7 @@ class SDL_Semaphore(ctypes.Structure):
SDL_FUNC("SDL_SignalSemaphore", ctypes.c_int, ctypes.POINTER(SDL_Semaphore))
SDL_FUNC("SDL_GetSemaphoreValue", ctypes.c_uint32, ctypes.POINTER(SDL_Semaphore))

class SDL_Condition(ctypes.Structure):
class SDL_Condition(ctypes.c_void_p):
...

SDL_FUNC("SDL_CreateCondition", ctypes.POINTER(SDL_Condition))
Expand Down
8 changes: 4 additions & 4 deletions sdl3/SDL_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SDL_FUNC("SDLNet_Init", ctypes.c_int)
SDL_FUNC("SDLNet_Quit", None)

class SDLNet_Address(ctypes.Structure):
class SDLNet_Address(ctypes.c_void_p):
...

SDL_FUNC("SDLNet_ResolveHostname", ctypes.POINTER(SDLNet_Address), ctypes.c_char_p)
Expand All @@ -35,13 +35,13 @@ class SDLNet_Address(ctypes.Structure):
SDL_FUNC("SDLNet_GetLocalAddresses", ctypes.POINTER(ctypes.POINTER(SDLNet_Address)), ctypes.POINTER(ctypes.c_int))
SDL_FUNC("SDLNet_FreeLocalAddresses", None, ctypes.POINTER(ctypes.POINTER(SDLNet_Address)))

class SDLNet_StreamSocket(ctypes.Structure):
class SDLNet_StreamSocket(ctypes.c_void_p):
...

SDL_FUNC("SDLNet_CreateClient", ctypes.POINTER(SDLNet_StreamSocket), ctypes.POINTER(SDLNet_Address), ctypes.c_uint16)
SDL_FUNC("SDLNet_WaitUntilConnected", ctypes.c_int, ctypes.POINTER(SDLNet_StreamSocket), ctypes.c_int32)

class SDLNet_Server(ctypes.Structure):
class SDLNet_Server(ctypes.c_void_p):
...

SDL_FUNC("SDLNet_CreateServer", ctypes.POINTER(SDLNet_Server), ctypes.POINTER(SDLNet_Address), ctypes.c_uint16)
Expand All @@ -56,7 +56,7 @@ class SDLNet_Server(ctypes.Structure):
SDL_FUNC("SDLNet_SimulateStreamPacketLoss", None, ctypes.POINTER(SDLNet_StreamSocket), ctypes.c_int)
SDL_FUNC("SDLNet_DestroyStreamSocket", None, ctypes.POINTER(SDLNet_StreamSocket))

class SDLNet_DatagramSocket(ctypes.Structure):
class SDLNet_DatagramSocket(ctypes.c_void_p):
...

class SDLNet_Datagram(ctypes.Structure):
Expand Down
4 changes: 2 additions & 2 deletions sdl3/SDL_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class SDL_Vertex(ctypes.Structure):
SDL_LOGICAL_PRESENTATION_OVERSCAN = 3
SDL_LOGICAL_PRESENTATION_INTEGER_SCALE = 4

class SDL_Renderer(ctypes.Structure):
class SDL_Renderer(ctypes.c_void_p):
...

class SDL_Texture(ctypes.Structure):
class SDL_Texture(ctypes.c_void_p):
...

SDL_FUNC("SDL_GetNumRenderDrivers", ctypes.c_int)
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_rtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

SDL_FUNC("RTF_Version", ctypes.c_int)

class RTF_Context(ctypes.Structure):
class RTF_Context(ctypes.c_void_p):
...

RTF_FontFamily = ctypes.c_int
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_Sensor(ctypes.Structure):
class SDL_Sensor(ctypes.c_void_p):
...

SDL_SensorID = ctypes.c_uint32
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SDL_StorageInterface(ctypes.Structure):
("space_remaining", ctypes.CFUNCTYPE(ctypes.c_uint64, ctypes.c_void_p))
]

class SDL_Storage(ctypes.Structure):
class SDL_Storage(ctypes.c_void_p):
...

SDL_FUNC("SDL_OpenTitleStorage", ctypes.POINTER(SDL_Storage), ctypes.c_char_p, SDL_PropertiesID)
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
SDL_FLIP_HORIZONTAL = 1
SDL_FLIP_VERTICAL = 2

class SDL_SurfaceData(ctypes.Structure):
class SDL_SurfaceData(ctypes.c_void_p):
...

class SDL_Surface(ctypes.Structure):
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class SDL_Thread(ctypes.Structure):
class SDL_Thread(ctypes.c_void_p):
...

SDL_ThreadID = ctypes.c_uint64
Expand Down
2 changes: 1 addition & 1 deletion sdl3/SDL_ttf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

SDL_FUNC("TTF_ByteSwappedUNICODE", None, ctypes.c_bool)

class TTF_Font(ctypes.Structure):
class TTF_Font(ctypes.c_void_p):
...

SDL_FUNC("TTF_Init", ctypes.c_int)
Expand Down
4 changes: 2 additions & 2 deletions sdl3/SDL_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
SDL_SYSTEM_THEME_LIGHT = 1
SDL_SYSTEM_THEME_DARK = 2

class SDL_DisplayModeData(ctypes.Structure):
class SDL_DisplayModeData(ctypes.c_void_p):
...

class SDL_DisplayMode(ctypes.Structure):
Expand All @@ -44,7 +44,7 @@ class SDL_DisplayMode(ctypes.Structure):
SDL_ORIENTATION_PORTRAIT = 3
SDL_ORIENTATION_PORTRAIT_FLIPPED = 4

class SDL_Window(ctypes.Structure):
class SDL_Window(ctypes.c_void_p):
...

SDL_WindowFlags = ctypes.c_uint64
Expand Down
6 changes: 3 additions & 3 deletions sdl3/SDL_vulkan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

SDL_SET_CURRENT_DLL(SDL_DLL)

class VkInstance(ctypes.Structure):
class VkInstance(ctypes.c_void_p):
...

class VkPhysicalDevice(ctypes.Structure):
class VkPhysicalDevice(ctypes.c_void_p):
...

class VkAllocationCallbacks(ctypes.Structure):
class VkAllocationCallbacks(ctypes.c_void_p):
...

VkSurfaceKHR = ctypes.c_uint64
Expand Down
2 changes: 1 addition & 1 deletion sdl3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

__initialized__ = __name__.split(".")[0] in sys.modules if "." in __name__ else False
__module__ = sys.modules[__name__.split(".")[0] if "." in __name__ else __name__]
__loader__ = ctypes.CDLL if "win32" not in sys.platform else ctypes.windll.LoadLibrary
__loader__ = ctypes.CDLL if "win32" not in sys.platform else ctypes.WinDLL

if not __initialized__:
functions, dllMap, dll = {}, {}, None
Expand Down

0 comments on commit 287e1a3

Please sign in to comment.