- [WIP] Fase 3 en process
This commit is contained in:
75
source/backends/backend.h
Normal file
75
source/backends/backend.h
Normal file
@@ -0,0 +1,75 @@
|
||||
#pragma once
|
||||
|
||||
#define SDL3 1
|
||||
#define SFML 2
|
||||
#define EMSCRIPTEN 3
|
||||
|
||||
#ifndef BACKEND
|
||||
#define BACKEND SDL3
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace backend
|
||||
{
|
||||
enum state_t { running=0, exiting=1, quitting=2 };
|
||||
extern state_t current_state;
|
||||
|
||||
void init();
|
||||
void quit();
|
||||
void poll_events();
|
||||
const state_t& state();
|
||||
void exit();
|
||||
uint64_t get_time_ms();
|
||||
|
||||
namespace video
|
||||
{
|
||||
void init();
|
||||
void quit();
|
||||
void render();
|
||||
void raise_window();
|
||||
void cursor(const bool value);
|
||||
}
|
||||
|
||||
namespace audio
|
||||
{
|
||||
void init();
|
||||
void quit();
|
||||
void render();
|
||||
}
|
||||
|
||||
namespace input
|
||||
{
|
||||
void reset();
|
||||
|
||||
namespace key
|
||||
{
|
||||
bool down(uint8_t i);
|
||||
bool press(uint8_t i);
|
||||
int press();
|
||||
bool any();
|
||||
void text(const bool enable);
|
||||
const char *utf8char();
|
||||
}
|
||||
|
||||
namespace mouse
|
||||
{
|
||||
int posx();
|
||||
int posy();
|
||||
int wheel();
|
||||
bool down(uint8_t i);
|
||||
bool press(uint8_t i);
|
||||
bool dblclick();
|
||||
void discard();
|
||||
bool inside(int x, int y, int w, int h);
|
||||
}
|
||||
|
||||
namespace pad
|
||||
{
|
||||
void init();
|
||||
bool down(int8_t i);
|
||||
bool press(int8_t i);
|
||||
int press();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user