Update
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>Debug</GenerateDebugInformation>
|
||||
@@ -158,6 +158,7 @@
|
||||
<ClInclude Include="Container\TypeList.h" />
|
||||
<ClInclude Include="Database\SQLite\SQLite.h" />
|
||||
<ClInclude Include="Database\SQLite\sqlite3.h" />
|
||||
<ClInclude Include="Timer.h" />
|
||||
<ClInclude Include="Time\HighResolutionClock.h" />
|
||||
<ClInclude Include="Time\SystemClock.h" />
|
||||
<ClInclude Include="Time\Time.h" />
|
||||
@@ -174,6 +175,7 @@
|
||||
<ClCompile Include="Container\List.cpp" />
|
||||
<ClCompile Include="Database\SQLite\SQLite.cpp" />
|
||||
<ClCompile Include="Database\SQLite\sqlite3.c" />
|
||||
<ClCompile Include="Timer.cpp" />
|
||||
<ClCompile Include="Time\HighResolutionClock.cpp" />
|
||||
<ClCompile Include="Time\SystemClock.cpp" />
|
||||
<ClCompile Include="Time\Time.cpp" />
|
||||
|
||||
@@ -95,6 +95,9 @@
|
||||
<ClCompile Include="Type\Long.cpp">
|
||||
<Filter>Source Files\Type</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Timer.cpp">
|
||||
<Filter>Source Files\Time</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BlitzUtility.h">
|
||||
@@ -142,6 +145,9 @@
|
||||
<ClInclude Include="Type\Long.h">
|
||||
<Filter>Header Files\Type</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Timer.h">
|
||||
<Filter>Header Files\Time</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\BlitzUtility.bb">
|
||||
|
||||
@@ -153,8 +153,9 @@ Function BU_Helper_Window_MakeBorderless(HWND=0)
|
||||
newH = clientH
|
||||
|
||||
; Apply changes
|
||||
BU_User32_SetWindowLong HWND, -16, $01000000
|
||||
BU_User32_SetWindowPos HWND, 0, newX, newY, newW, newH, $4 + $10 + $20 + $40
|
||||
BU_User32_SetWindowLong HWND, -16, $10000000
|
||||
BU_User32_SetWindowLong HWND, -20, $02840020
|
||||
BU_User32_SetWindowPos HWND, 0, newX, newY, newW, newH, $2074
|
||||
End Function
|
||||
|
||||
Function BU_Helper_Window_Center(HWND=0, Monitor=0)
|
||||
@@ -527,6 +528,3 @@ Function Vector3_Create.Vector3(X#, Y#, Z#)
|
||||
Return vec
|
||||
End Function
|
||||
|
||||
|
||||
;~IDEal Editor Parameters:
|
||||
;~C#Blitz3D
|
||||
@@ -29,7 +29,7 @@ BU_List_Insert(list%, element*)
|
||||
BU_List_InsertEx(list%, element*, other*)
|
||||
BU_List_Remove(list%, element*)
|
||||
; -- TypeList (Single Type)
|
||||
BU_TypeList_New%(obj*)
|
||||
BU_TypeList_Create%(obj*)
|
||||
BU_TypeList_Activate(list%)
|
||||
BU_TypeList_Deactivate(list%)
|
||||
BU_TypeList_Destroy(list%)
|
||||
@@ -150,6 +150,10 @@ BU_Time_Now%()
|
||||
BU_Time_Create%(seconds%, minutes%, hours%, days%, months%, years%, isDST%)
|
||||
BU_Time_Destroy(pTime%)
|
||||
BU_Time_Format$(pTime%, formatString$)
|
||||
; -- Timer
|
||||
BU_Timer_Create%(Interval%, hwnd%) : "_BU_Timer_Create@8"
|
||||
BU_Timer_Destroy%(Timer%) : "_BU_Timer_Destroy@4"
|
||||
BU_Timer_Wait%(Timer%) : "_BU_Timer_Wait@4"
|
||||
; -- SystemClock
|
||||
BU_SystemClock_Now%()
|
||||
BU_SystemClock_Destroy(pSystemClock%)
|
||||
@@ -227,11 +231,11 @@ BU_Double_ModF%(pThis%, fOther%) :"_BU_Double_ModF@8"
|
||||
|
||||
; Utility ---------------------------------------------------------------------
|
||||
; -- Display Enumerator
|
||||
BU_DisplayEnumerator_Create%()
|
||||
BU_DisplayEnumerator_Destroy(DisplayEnumerator%)
|
||||
BU_DisplayEnumerator_Enumerate%(DisplayEnumerator%)
|
||||
BU_DisplayEnumerator_Count%(DisplayEnumerator%)
|
||||
BU_DisplayEnumerator_Retrieve(DisplayEnumerator%, index%, Rect*)
|
||||
BU_DisplayEnumerator_Create%() :"_BU_DisplayEnumerator_Create@0"
|
||||
BU_DisplayEnumerator_Destroy(DisplayEnumerator%) :"_BU_DisplayEnumerator_Destroy@4"
|
||||
BU_DisplayEnumerator_Enumerate%(DisplayEnumerator%) :"_BU_DisplayEnumerator_Enumerate@4"
|
||||
BU_DisplayEnumerator_Count%(DisplayEnumerator%) :"_BU_DisplayEnumerator_Count@4"
|
||||
BU_DisplayEnumerator_Retrieve(DisplayEnumerator%, index%, Rect*) :"_BU_DisplayEnumerator_Retrieve@12"
|
||||
; -- Indexer V1 (Array)
|
||||
BU_IndexerV1_Create%()
|
||||
BU_IndexerV1_Destroy(Indexer%)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// BlitzUtility - Expanding the normal Blitz functionality.
|
||||
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "Timer.h"
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <chrono>
|
||||
#include <future>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct BlitzTimerInfo {
|
||||
uint32_t Interval;
|
||||
|
||||
HANDLE hSemaphore;
|
||||
};
|
||||
|
||||
int32_t BU_Timer_Index = 0;
|
||||
std::map<int32_t, BlitzTimerInfo> BU_Timer_List;// = new std::map<int32_t, HANDLE>();
|
||||
|
||||
VOID CALLBACK BU_Timer_PROC(
|
||||
_In_ HWND hwnd,
|
||||
_In_ UINT uMsg,
|
||||
_In_ UINT_PTR idEvent,
|
||||
_In_ DWORD dwTime
|
||||
) {
|
||||
BlitzTimerInfo myTimer = BU_Timer_List[idEvent];
|
||||
ReleaseSemaphore(myTimer.hSemaphore, 1, NULL);
|
||||
}
|
||||
|
||||
DLL_FUNCTION(int32_t) BU_Timer_Create(uint32_t Interval, HWND hwnd) {
|
||||
UINT_PTR timer = SetTimer(hwnd, 32767, Interval, &BU_Timer_PROC);
|
||||
|
||||
if (timer) {
|
||||
BlitzTimerInfo myTimer = BlitzTimerInfo();
|
||||
myTimer.Interval = Interval;
|
||||
myTimer.hSemaphore = CreateSemaphore(NULL, 0, 32767, NULL);
|
||||
BU_Timer_List[timer] = myTimer;
|
||||
return timer;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_FUNCTION(void) BU_Timer_Destroy(uint32_t Id) {
|
||||
BlitzTimerInfo myTimer = BU_Timer_List[Id];
|
||||
CloseHandle(myTimer.hSemaphore);
|
||||
BU_Timer_List.erase(Id);
|
||||
}
|
||||
|
||||
DLL_FUNCTION(int32_t) BU_Timer_Wait(uint32_t Id) {
|
||||
BlitzTimerInfo myTimer = BU_Timer_List[Id];
|
||||
|
||||
//HANDLE myHandles[] = { myTimer.hSemaphore };
|
||||
//MsgWaitForMultipleObjects(1, myHandles, true, 0xFFFFFFFF, QS_TIMER);
|
||||
return WaitForSingleObject(myTimer.hSemaphore, 0xFFFFFFFF);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// BlitzUtility - Expanding the normal Blitz functionality.
|
||||
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
#include "BlitzUtility.h"
|
||||
#include <map>
|
||||
|
||||
//DLL_FUNCTION(int32_t) BU_Timer_Create(uint32_t Interval);
|
||||
//DLL_FUNCTION(void) BU_Timer_Destroy(uint32_t Id);
|
||||
//DLL_FUNCTION(int32_t) BU_Timer_Wait(uint32_t Id);
|
||||
@@ -42,7 +42,7 @@ DLL_FUNCTION(uint32_t) BU_DisplayEnumerator_Count(DisplayEnumerator* displayEnum
|
||||
return displayEnumerator->displays.size();
|
||||
}
|
||||
|
||||
DLL_FUNCTION(void) BU_DisplayEnumerator_Retrieve(DisplayEnumerator* displayEnumerator, uint32_t index, PRECT display) {
|
||||
DLL_FUNCTION(void) BU_DisplayEnumerator_Retrieve(DisplayEnumerator* displayEnumerator, uint32_t index, LPRECT display) {
|
||||
// Retrieve the requested index.
|
||||
auto iterator = displayEnumerator->displays.begin();
|
||||
std::advance(iterator, index);
|
||||
|
||||
@@ -27,12 +27,7 @@ BOOL CALLBACK BU_DisplayEnumerator_Callback(HMONITOR hMonitor, HDC hdcMonitor, L
|
||||
|
||||
// Exported functions.
|
||||
DLL_FUNCTION(DisplayEnumerator*) BU_DisplayEnumerator_Create();
|
||||
#pragma comment(linker, "/EXPORT:BU_DisplayEnumerator_Create=_BU_DisplayEnumerator_Create@0")
|
||||
DLL_FUNCTION(void) BU_DisplayEnumerator_Destroy(DisplayEnumerator* displayEnumerator);
|
||||
#pragma comment(linker, "/EXPORT:BU_DisplayEnumerator_Destroy=_BU_DisplayEnumerator_Destroy@4")
|
||||
DLL_FUNCTION(uint32_t) BU_DisplayEnumerator_Enumerate(DisplayEnumerator* displayEnumerator);
|
||||
#pragma comment(linker, "/EXPORT:BU_DisplayEnumerator_Enumerate=_BU_DisplayEnumerator_Enumerate@4")
|
||||
DLL_FUNCTION(uint32_t) BU_DisplayEnumerator_Count(DisplayEnumerator* displayEnumerator);
|
||||
#pragma comment(linker, "/EXPORT:BU_DisplayEnumerator_Count=_BU_DisplayEnumerator_Count@4")
|
||||
DLL_FUNCTION(void) BU_DisplayEnumerator_Retrieve(DisplayEnumerator* displayEnumerator, uint32_t index, LPRECT display);
|
||||
#pragma comment(linker, "/EXPORT:BU_DisplayEnumerator_Retrieve=_BU_DisplayEnumerator_Retrieve@12")
|
||||
|
||||
Reference in New Issue
Block a user