mirror of
https://github.com/ProgramSnail/snake_2024.git
synced 2025-12-24 15:18:43 +00:00
initial template changes, xmake integration
This commit is contained in:
parent
a1430a42aa
commit
b4a4ffc08a
7 changed files with 27 additions and 17 deletions
40
include/Engine.h
Normal file
40
include/Engine.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
//
|
||||
// DO NOT MODIFY THIS FILE
|
||||
//
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SCREEN_WIDTH 1024
|
||||
#define SCREEN_HEIGHT 768
|
||||
|
||||
// backbuffer
|
||||
extern uint32_t buffer[SCREEN_HEIGHT][SCREEN_WIDTH];
|
||||
|
||||
enum
|
||||
{
|
||||
VK_ESCAPE,
|
||||
VK_SPACE,
|
||||
VK_LEFT,
|
||||
VK_UP,
|
||||
VK_RIGHT,
|
||||
VK_DOWN,
|
||||
VK_RETURN,
|
||||
|
||||
VK__COUNT
|
||||
};
|
||||
|
||||
// VK_SPACE, VK_RIGHT, VK_LEFT, VK_UP, VK_DOWN, etc.
|
||||
bool is_key_pressed(int button_vk_code);
|
||||
bool is_mouse_button_pressed(int mouse_button);
|
||||
int get_cursor_x();
|
||||
int get_cursor_y();
|
||||
|
||||
void initialize();
|
||||
void finalize();
|
||||
|
||||
void act(float dt);
|
||||
void draw();
|
||||
|
||||
void schedule_quit_game();
|
||||
Loading…
Add table
Add a link
Reference in a new issue