Compare commits
No commits in common. "beta" and "main" have entirely different histories.
10 changed files with 0 additions and 139 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +0,0 @@
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.so
|
|
||||||
*.exe
|
|
5
AUTHORS
5
AUTHORS
|
@ -1,5 +0,0 @@
|
||||||
Egor Baranovsky (egorgeek)
|
|
||||||
baranovsky.egorka@yandex.ru
|
|
||||||
|
|
||||||
Denis Butorin (dekabu)
|
|
||||||
dyonya0.0@gmail.com
|
|
35
Makefile
35
Makefile
|
@ -1,35 +0,0 @@
|
||||||
PREFIX = /usr
|
|
||||||
HEADERSDIR = $(PREFIX)/include/glazir
|
|
||||||
LIBDIR = $(PREFIX)/lib64
|
|
||||||
|
|
||||||
HEADERS = src/glazir.h \
|
|
||||||
src/types.h \
|
|
||||||
src/window.h \
|
|
||||||
src/version.h
|
|
||||||
|
|
||||||
OBJ = src/window.o \
|
|
||||||
src/main.o
|
|
||||||
|
|
||||||
libglazir.a: $(OBJ)
|
|
||||||
ar rcs libglazir.a $(OBJ)
|
|
||||||
|
|
||||||
install/headers:
|
|
||||||
mkdir -p $(HEADERSDIR)
|
|
||||||
cp $(HEADERS) $(HEADERSDIR)
|
|
||||||
|
|
||||||
install/static: libglazir.a
|
|
||||||
mkdir -p $(LIBDIR)
|
|
||||||
cp libglazir.a $(LIBDIR)
|
|
||||||
|
|
||||||
install: install/headers install/static
|
|
||||||
|
|
||||||
uninstall/headers:
|
|
||||||
rm -r $(HEADERSDIR)
|
|
||||||
|
|
||||||
uninstall/static:
|
|
||||||
rm $(LIBDIR)/libglazir.a
|
|
||||||
|
|
||||||
uninstall: uninstall/headers uninstall/static
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm src/*.o
|
|
17
README.md
17
README.md
|
@ -1,19 +1,2 @@
|
||||||
# glazir
|
# glazir
|
||||||
|
|
||||||
## Описание
|
|
||||||
C-библиотека для математических и физических визуализаций, основанная на [SDL3](https://www.libsdl.org/)
|
|
||||||
|
|
||||||
## Инструкция по сборке
|
|
||||||
1. Склонируйте репозиторий и перейдите в директорию
|
|
||||||
```sh
|
|
||||||
git clone https://git.kpfu.su/GLAZIR/glazir
|
|
||||||
cd glazir
|
|
||||||
```
|
|
||||||
2. Соберите библиотеку
|
|
||||||
```sh
|
|
||||||
make
|
|
||||||
```
|
|
||||||
3. Установите библиотеку
|
|
||||||
```sh
|
|
||||||
make install
|
|
||||||
```
|
|
||||||
|
|
13
src/glazir.h
13
src/glazir.h
|
@ -1,13 +0,0 @@
|
||||||
#ifndef GLAZIR
|
|
||||||
#define GLAZIR
|
|
||||||
|
|
||||||
#include "version.h"
|
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
void gr_init(int argc, char *argv[]);
|
|
||||||
|
|
||||||
void gr_event(gr_Event *event);
|
|
||||||
|
|
||||||
void gr_frame();
|
|
||||||
|
|
||||||
#endif
|
|
36
src/main.c
36
src/main.c
|
@ -1,36 +0,0 @@
|
||||||
#define SDL_MAIN_USE_CALLBACKS 1
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include <SDL3/SDL_main.h>
|
|
||||||
|
|
||||||
#include "glazir.h"
|
|
||||||
|
|
||||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
|
||||||
{
|
|
||||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
|
||||||
SDL_Log("Не удалось инициализировать SDL: %s", SDL_GetError());
|
|
||||||
return SDL_APP_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gr_init(argc, argv);
|
|
||||||
|
|
||||||
return SDL_APP_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
|
||||||
{
|
|
||||||
gr_event(event);
|
|
||||||
|
|
||||||
return SDL_APP_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
|
||||||
{
|
|
||||||
gr_frame();
|
|
||||||
|
|
||||||
return SDL_APP_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
10
src/types.h
10
src/types.h
|
@ -1,10 +0,0 @@
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
|
|
||||||
struct _gr_Window {
|
|
||||||
SDL_Window* w;
|
|
||||||
SDL_Renderer* r;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _gr_Window gr_Window;
|
|
||||||
|
|
||||||
typedef SDL_Event gr_Event;
|
|
|
@ -1,3 +0,0 @@
|
||||||
#define PIE_VERSION_MAJOR 0
|
|
||||||
#define PIE_VERSION_MINOR 1
|
|
||||||
#define PIE_VERSION_PATCH 0
|
|
11
src/window.c
11
src/window.c
|
@ -1,11 +0,0 @@
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
int gr_createWindow(const char* title, int width, int height, gr_Window* window)
|
|
||||||
{
|
|
||||||
return SDL_CreateWindowAndRenderer(title, width, height, 0, &window->w, &window->r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gr_drawWindow(gr_Window* window)
|
|
||||||
{
|
|
||||||
SDL_RenderPresent(window->r);
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include "types.h"
|
|
||||||
|
|
||||||
int gr_createWindow(const char* title, int width, int height, gr_Window* window);
|
|
||||||
|
|
||||||
void gr_drawWindow(gr_Window* window);
|
|
Loading…
Add table
Add a link
Reference in a new issue