Do some stuff
This commit is contained in:
33
peripherals/switches.h
Normal file
33
peripherals/switches.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by bruno on 17.2.2025.
|
||||
//
|
||||
|
||||
#ifndef RISCB_SWITCHES_H
|
||||
#define RISCB_SWITCHES_H
|
||||
|
||||
#include <SDL_rect.h>
|
||||
#include <SDL_render.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t value;
|
||||
uint16_t oldValue;
|
||||
SDL_Rect *rect;
|
||||
SDL_Rect *outRect;
|
||||
SDL_Texture *texture;
|
||||
SDL_Rect rects[16];
|
||||
SDL_Rect outRects[16];
|
||||
} Switches;
|
||||
|
||||
void render_switch_matrix(SDL_Renderer *renderer, Switches *switches);
|
||||
|
||||
void update_switches_texture(SDL_Renderer *renderer, Switches *display);
|
||||
|
||||
void toggle_switch(SDL_Rect rect, Switches *switches);
|
||||
|
||||
void init_switches(Switches *switches, SDL_Renderer *renderer, int x, int y, int width, int height);
|
||||
|
||||
void render_switches_segment(Switches *display, SDL_Renderer *renderer);
|
||||
|
||||
void destroy_switches_segment(Switches *switches);
|
||||
|
||||
#endif //RISCB_SWITCHES_H
|
Reference in New Issue
Block a user