This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mongo.h" | |
// opens handle to user collection | |
int users_collection_get (void) { | |
int errors = 0; | |
users_collection = mongo_collection_get (USERS_COLL_NAME); | |
if (!users_collection) { | |
log_msg (stderr, LOG_ERROR, LOG_NO_TYPE, "Failed to get handle to users collection!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/ui.h" | |
#include "cengine/ui/font.h" | |
#include "cengine/ui/dropdown.h" | |
void dropdown_create (void) { | |
Renderer *main_renderer = renderer_get_by_name ("main"); | |
Font *font = ui_font_get_default (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/ui.h" | |
#include "cengine/ui/font.h" | |
#include "cengine/ui/textbox.h" | |
// creates and display a textbox at the center of the screen | |
void display_text (const char *text) { | |
Renderer *main_renderer = renderer_get_by_name ("main"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/types/types.h" | |
#include "cengine/renderer.h" | |
#include "cengine/ui/ui.h" | |
#include "cengine/ui/image.h" | |
#include "cengine/ui/panel.h" | |
Panel *images_panel = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/ui.h" | |
#include "cengine/ui/panel.h" | |
// you can use a panel as background for your application | |
void set_background (void) { | |
Renderer *main_renderer = renderer_get_by_name ("main"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/ui.h" | |
#include "cengine/ui/font.h" | |
#include "cengine/ui/inputfield.h" | |
void input_field_create () { | |
Renderer *main_renderer = renderer_get_by_name ("main"); | |
Font *font = ui_font_get_default (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/image.h" | |
void cimage_like_image_create (const char *filename, | |
SDL_Texture *overlay_texture, SDL_Texture *selected_texture) { | |
if (filename && overlay_texture && selected_texture) { | |
Renderer *main_renderer = renderer_get_by_name ("main"); | |
Image *image = ui_image_create_static (0, 0, main_renderer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/image.h" | |
void image_display_with_outline (const char *filename) { | |
if (filename) { | |
Renderer *main_renderer = renderer_get_by_name ("main"); | |
Image *image = ui_image_create_static (0, 0, main_renderer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cengine/renderer.h" | |
#include "cengine/ui/font.h" | |
int load_font (Renderer *renderer) { | |
int retval = 1; | |
if (renderer) { | |
// first create the font structure | |
Font *main_font = ui_font_create ("roboto", "./assets/fonts/Roboto-Regular.ttf"); |
NewerOlder