summaryrefslogtreecommitdiff
path: root/draw/glui.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-10-01 19:54:52 +0100
committerFreeArtMan <dos21h@gmail.com>2015-10-01 19:54:52 +0100
commit240c02c5d64ee02659d0bcbbc61ef3680cbf8ea2 (patch)
treed8bc56d6d66b92b03334aec3b64b50403704eb4a /draw/glui.c
parent588b76e576108a82bcf7abb660def28b4a99ba5a (diff)
downloadradiola-240c02c5d64ee02659d0bcbbc61ef3680cbf8ea2.tar.gz
radiola-240c02c5d64ee02659d0bcbbc61ef3680cbf8ea2.zip
Added SDL waterfall prototype api
Diffstat (limited to 'draw/glui.c')
-rw-r--r--draw/glui.c121
1 files changed, 121 insertions, 0 deletions
diff --git a/draw/glui.c b/draw/glui.c
index e69de29..3e85646 100644
--- a/draw/glui.c
+++ b/draw/glui.c
@@ -0,0 +1,121 @@
+#include "glui.h"
+
+#define DEFAULT_TITLE "RADIOLA"
+#define SCREEN_X 640
+#define SCREEN_Y 480
+
+int glui_init( glui_t **t )
+{
+ int ret=-1;
+
+ glui_t *tui = NULL;
+
+ tui = malloc( sizeof(glui_t) );
+ if (tui == NULL)
+ {
+ return -1;
+ }
+
+ memset(tui, 0, sizeof(glui_t));
+
+ if ( SDL_Init(SDL_INIT_VIDEO) != 0)
+ {
+ printf("Cannot init sdl\n");
+ return -1;
+ }
+
+ tui->win = SDL_CreateWindow("Hello World!", 100, 100, SCREEN_X, SCREEN_Y, SDL_WINDOW_SHOWN);
+ if (tui->win == NULL)
+ {
+ printf("Couldnt create SDL window\n");
+ return -1;
+ }
+
+ tui->rend = SDL_CreateRenderer( tui->win, -1, SDL_RENDERER_ACCELERATED);
+
+
+
+ return ret;
+}
+
+
+//init waterfall
+int glui_waterfall( glui_t **t, glui_waterfall_t **w )
+{
+ int ret=-1;
+
+
+ return ret;
+}
+
+
+//first draw, draw all buffer
+int glui_waterfall_draw( glui_waterfall_t *w )
+{
+ int ret=-1;
+
+
+ return ret;
+}
+
+
+//redraw only changed lines
+int glui_waterfall_redraw( glui_waterfall_t *w )
+{
+ int ret=-1;
+
+
+ return ret;
+}
+
+
+//update params of waterfall and then need to draw not redraw
+int glui_waterfall_update( glui_t *w )
+{
+ int ret=-1;
+
+
+ return ret;
+}
+
+
+//push one line of data to buffer
+int glui_waterfall_data( glui_t *w, int len, uint8_t *buf )
+{
+ int ret=-1;
+
+
+ return ret;
+}
+
+
+//return color
+uint8_t glui_waterfall_color( uint8_t d )
+{
+ uint8_t c;
+
+
+ return c;
+}
+
+
+//close terminal ui
+int glui_close( glui_t *t )
+{
+ int ret=0;
+
+ if ( t->rend )
+ {
+ SDL_DestroyRenderer( t->rend );
+ }
+
+ if ( t->win != NULL )
+ {
+ SDL_DestroyWindow( t->win );
+ }
+
+ SDL_Quit();
+
+
+ return ret;
+} \ No newline at end of file