Skip to content

Commit

Permalink
Fix Windows 32-bit builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Dec 12, 2021
1 parent 5ef1797 commit 95eb2e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/platform/windows/windows-audio.c
Expand Up @@ -51,17 +51,17 @@ typedef struct {
bool inUse;
} AudioStream;

void OnBufferEnd(IXAudio2VoiceCallback* This, void* pBufferContext) {
void WINAPI OnBufferEnd(IXAudio2VoiceCallback* This, void* pBufferContext) {
AudioStream* channel = (AudioStream*) pBufferContext;
channel->inUse = false;
}

void OnStreamEnd(IXAudio2VoiceCallback* This) { }
void OnVoiceProcessingPassEnd(IXAudio2VoiceCallback* This) { }
void OnVoiceProcessingPassStart(IXAudio2VoiceCallback* This, UINT32 SamplesRequired) { }
void OnBufferStart(IXAudio2VoiceCallback* This, void* pBufferContext) { }
void OnLoopEnd(IXAudio2VoiceCallback* This, void* pBufferContext) { }
void OnVoiceError(IXAudio2VoiceCallback* This, void* pBufferContext, HRESULT Error) { }
void WINAPI OnStreamEnd(IXAudio2VoiceCallback* This) { }
void WINAPI OnVoiceProcessingPassEnd(IXAudio2VoiceCallback* This) { }
void WINAPI OnVoiceProcessingPassStart(IXAudio2VoiceCallback* This, UINT32 SamplesRequired) { }
void WINAPI OnBufferStart(IXAudio2VoiceCallback* This, void* pBufferContext) { }
void WINAPI OnLoopEnd(IXAudio2VoiceCallback* This, void* pBufferContext) { }
void WINAPI OnVoiceError(IXAudio2VoiceCallback* This, void* pBufferContext, HRESULT Error) { }

static struct {
IXAudio2* xaudio;
Expand Down
6 changes: 3 additions & 3 deletions src/platform/windows/windows.c
Expand Up @@ -156,7 +156,7 @@ static void processXInputState(XINPUT_STATE* xInputState) {
}
}

static LRESULT CALLBACK winProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) {
static LRESULT CALLBACK messageHandler(HWND window, UINT message, WPARAM wParam, LPARAM lParam) {
if (!running) {
return DefWindowProc(window, message, wParam, lParam);
}
Expand Down Expand Up @@ -245,12 +245,12 @@ static LRESULT CALLBACK winProc(HWND window, UINT message, WPARAM wParam, LPARAM
return DefWindowProc(window, message, wParam, lParam);
}

int32_t CALLBACK WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, int32_t showWindow) {
int32_t WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, int32_t showWindow) {
HWND window = createOpenGLWindow( &(CreateOpenGLWindowArgs) {
.title = "space-shooter.c (Windows)",
.majorVersion = SOGL_MAJOR_VERSION,
.minorVersion = SOGL_MINOR_VERSION,
.winCallback = winProc,
.winCallback = messageHandler,
.vsync = true
});

Expand Down

0 comments on commit 95eb2e9

Please sign in to comment.