LoadIcon:Int(hWnd:Int, file$z, index:Int) = "ExtractIconA@12"
for some reason program shuts down after executing freelibrary.. though
Extern "Win32" Function FreeLibrary:Int(hModule:Int)EndExtern Local libShell:Int = LoadLibraryA("shell32")If Not libShell Then Print "Error: No library loaded!"; End Print "Shell loaded. Now closing.."Print FreeLibrary(libShell)
StrictFunction Multiply (A, B) Return A * BEndFunctionFunction Minus (A, B) Return A - BEndFunctionFunction RotateElement(Element, X, Y, Z) Return X + Y + ZEnd Function
I made a test DLL lib.. and i guess im doing something wrong because when i try to close it than it crashes.
#pragma once#ifdef OCULUSDLL_EXPORTS#define OCULUSDLL_API __declspec(dllexport)#else#define OCULUSDLL_API __declspec(dllimport)#endifextern "C" OCULUSDLL_API int InitOculus(int(*BM_VRLoop)());
int InitOculus(int (* BM_VRLoop)()){ // Initializes LibOVR, and the Rift ovrInitParams initParams = { ovrInit_RequestVersion | ovrInit_FocusAware, OVR_MINOR_VERSION, NULL, 0, 0 }; ovrResult result = ovr_Initialize(&initParams); VALIDATE(OVR_SUCCESS(result), "Failed to initialize libOVR."); VALIDATE(DIRECTX.InitWindow(NULL, L"OculusDLL"), "Failed to open window."); BMVRLoop = BM_VRLoop; DIRECTX.Run(MainLoop); ovr_Shutdown(); return(1);}
Global InitOculus:Int(pointer:Int Ptr)"Win32"Local VRLoopPointer:Int() = VRLoop 'BltzmaxNG callback function used by OculusGlobal lib:Byte Ptr = LoadLibraryW(CurrentDir$()+"/OculusDLL.dll")If lib Then InitOculus = GetProcAddress(lib, "InitOculus")Else Notify "OculusDLL not found.!" EndEndIfInitOculus(VRLoopPointer)'Worker function, this will be handed over to Oculus as a callback, so all action in BM'must be orchestraded in here somewhat.Function VRLoop:Int() EndFunction