SOLVED Need help with Resizing Swap chain, V-sync error, maybe an issue with .DLL?

EvanSki

Raccoon Jam Host
Alright so This is what im doing, I have a .dll that allows me to access and call windows OS functions, displaying popups, opening and closing the cd tray, ect..

When I call the cd tray to open or close, Game maker hangs and pauses until the cd tray is ready for a command.

notice how the counter stops when the CD tray is moving
during this time the console prints out "Resizing swap chain..."

The debugger does not notice a lag spike or a massive cpu useage, Task manager also notices no high usage of resources other then GMS just stop resending,
The debugger even hangs then shows the average frames drops significantly

All im doing in Game maker is when I press F1 it calls the Dll function to open the cd tray, F2 does the same thing but tells it to close.


Here is the .dll code, Im not very acquainted with C++ so please yell at me if im doing anything here majorly wrong
C++:
#include "pch.h"
#include <windows.h>
#include <mmsystem.h>

#pragma comment(lib, "winmm.lib")

#define fn_export extern "C" __declspec (dllexport)


//Function to test if the dll is sending and reciving data from the program
fn_export double test_linkage()
{
    return 1;
}

//Funtion to toggle the open/close state of the cd tray
fn_export double Open_CDTray()
{
        wchar_t const* ComStr = L"set cdaudio door open wait";
        int _Rcd = mciSendString(ComStr, NULL, NULL, NULL);
        return(_Rcd);
}

//Funtion to toggle the open/close state of the cd tray
fn_export double Close_CDTray()
{
    //gets if the cd tray is ready for another command
    bool _CD_Rdy = mciSendString(L"get cdaudio ready stop", NULL, NULL, NULL);
    if (_CD_Rdy == true)
    {
        //closes the cd tray
        wchar_t const* ComStr = L"set cdaudio door closed wait";
        int _Rcd = mciSendString(ComStr, NULL, NULL, NULL);
        //Then we return if closing the tray worked
        return(_Rcd);
    }
    else
    {
        //if the tray is not ready we send -1
        return(-1);
    }
}

If any one has any insight to prevent GMS from hanging while the cd tray moves, I'd appreciate it.
 
Top