Basic fenster rewrite of the original sfml version, but need to bring back the keyboard controls.
This commit is contained in:
parent
80ac4cefba
commit
972b432d51
3 changed files with 206 additions and 18 deletions
32
scratchpad/fenstertest.cpp
Normal file
32
scratchpad/fenstertest.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "fenster/fenster.h"
|
||||
#include "miniaudio.h"
|
||||
|
||||
#define W 480*2
|
||||
#define H 480
|
||||
|
||||
static int run() {
|
||||
Fenster f(W, H, "hello c++");
|
||||
int t = 0;
|
||||
while (f.loop(60)) {
|
||||
for (int i = 0; i < W; i++) {
|
||||
for (int j = 0; j < H; j++) {
|
||||
f.px(i, j) = i ^ j ^ t;
|
||||
}
|
||||
}
|
||||
if (f.key(0x1b)) {
|
||||
break;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine,
|
||||
int nCmdShow) {
|
||||
(void)hInstance, (void)hPrevInstance, (void)pCmdLine, (void)nCmdShow;
|
||||
return run();
|
||||
}
|
||||
#else
|
||||
int main() { return run(); }
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue