-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathc4g_context_linux.cpp
68 lines (47 loc) · 1.03 KB
/
c4g_context_linux.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
** C4GPU.
**
** For the latest info, see https://github.com/c4gpu/c4gpu_runtime/
**
** Copyright (C) 2017 Wang Renxin. All rights reserved.
*/
#include "c4g_context_linux.hpp"
#ifdef C4G_RUNTIME_OS_LINUX
namespace c4g {
namespace gl {
struct Context {
int _context = 0;
int _oldContext = 0;
};
Context* createContext(void) {
Context* result = new Context();
//result->_context = CreateContext();
pushContext(result);
return result;
}
void finishCreatingContext(Context* ctx) {
popContext(ctx);
}
void destroyContext(Context* ctx) {
if (!ctx) return;
//DestroyContext(result->_context);
delete ctx;
}
void pushContext(Context* ctx) {
if (!ctx) return;
//ctx->_oldContext = GetCurrentContext();
//SetCurrentContext(ctx->_context);
}
void popContext(Context* ctx) {
if (!ctx) return;
//SetCurrentContext(ctx->_oldContext);
//ctx->_oldContext = nullptr;
}
bool isContext(Context* ctx) {
if (!ctx) return false;
//return ctx->_context == GetCurrentContext();
return true;
}
}
}
#endif /* C4G_RUNTIME_OS_LINUX */