IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
core
public
ice
os
windows.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/os/handle.hxx
>
6
7
#if ISP_WINDOWS
8
9
#define WIN32_LEAN_AND_MEAN
10
#define NOMINMAX
11
#include <Windows.h>
12
13
template
<>
14
struct
ice::os::HandleDescriptor
<
ice
::
os::HandleType::File
>
15
{
18
using
PlatformHandleType = HANDLE;
19
22
static
constexpr
PlatformHandleType InvalidHandle = INVALID_HANDLE_VALUE;
23
24
static
bool
is_valid(PlatformHandleType handle,
void
*)
noexcept
25
{
26
return
/*handle != nullptr &&*/
handle != InvalidHandle;
27
}
28
29
static
bool
close(PlatformHandleType handle,
void
*)
noexcept
30
{
31
return
CloseHandle(handle) != 0;
32
}
33
};
34
35
template
<>
36
struct
ice::os::HandleDescriptor
<
ice
::
os::HandleType::DynLib
>
37
{
38
using
PlatformHandleType = HMODULE;
39
40
static
constexpr
PlatformHandleType InvalidHandle = NULL;
41
42
static
bool
is_valid(PlatformHandleType handle,
void
*)
noexcept
43
{
44
return
handle != InvalidHandle;
45
}
46
47
static
bool
close(PlatformHandleType handle,
void
*)
noexcept
48
{
49
return
FreeLibrary(handle) != 0;
50
}
51
};
52
53
namespace
ice::win32
54
{
55
56
using
FileHandle = ice::os::Handle<ice::os::HandleType::File>;
57
using
DynLibHandle = ice::os::Handle<ice::os::HandleType::DynLib>;
58
59
}
// namespace ice::win32
60
61
#endif
// ISP_WINDOWS
handle.hxx
ice::os::HandleType::File
@ File
Definition
handle.hxx:14
ice::os::HandleType::DynLib
@ DynLib
Definition
handle.hxx:15
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::os::HandleDescriptor
Definition
handle.hxx:26
Generated by
1.18.0