Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature pixbuf #46

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Backend/Core/include/sgBackendTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ typedef enum sg_drawing_surface_kind
{
SGDS_Unknown = 0, // Unknown, so do not draw onto this!
SGDS_Window = 1, // A window
SGDS_Bitmap = 2 // A surface, bitmap, or texture
SGDS_Bitmap = 2,
SGDS_Pixbuf = 3
} sg_drawing_surface_kind;

//
Expand All @@ -38,7 +39,7 @@ typedef struct sg_drawing_surface
sg_drawing_surface_kind kind;
int width;
int height;

// private data used by the backend
void * _data;
} sg_drawing_surface;
Expand All @@ -65,7 +66,7 @@ typedef struct sg_display
unsigned int format;
unsigned int num_modes;
sg_mode * modes;

// private data used by the backend
void * _data;
} sg_display;
Expand All @@ -84,7 +85,7 @@ typedef struct sg_system_data
unsigned int num_displays;
sg_display * displays;
sg_audiospec audio_specs;

} sg_system_data;

typedef enum sg_font_kind
Expand Down Expand Up @@ -114,7 +115,7 @@ typedef enum sg_sound_kind
typedef struct sg_sound_data
{
sg_sound_kind kind;

// private data used by backend
void * _data;
} sg_sound_data;
Expand All @@ -129,12 +130,12 @@ typedef enum sg_connection_kind
typedef struct sg_network_connection
{
sg_connection_kind kind;

// private data used by the backend
void * _socket;
} sg_network_connection;


typedef void *pointer;

typedef struct sg_window_data
Expand All @@ -144,11 +145,11 @@ typedef struct sg_window_data
int mouse_over;
int shown;
} sg_window_data;

#ifdef __cplusplus
}
#endif

// Stop aligning structs to one byte boundaries
//#pragma pack(pop)

Expand Down
12 changes: 12 additions & 0 deletions Backend/Core/include/sgInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ extern "C" {
sg_drawing_surface_surface_proc * draw_bitmap;
} sg_image_interface;

// Pixbuf related functions
//
// = creating and drawing pixbufs
//
typedef struct sg_pixbuf_interface
{
sg_create_surface_fn * create_pixbuf;
sg_drawing_surface_surface_proc * draw_pixbuf;

} sg_pixbuf_interface;

//
// Audio related functions
//
Expand Down Expand Up @@ -403,6 +414,7 @@ extern "C" {
sg_audio_interface audio;
sg_graphics_interface graphics;
sg_image_interface image;
sg_pixbuf_interface pixbuf;
sg_input_interface input;
sg_text_interface text;
sg_utils_interface utils;
Expand Down
1 change: 1 addition & 0 deletions Backend/SGSDL2/src/SGSDL2Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ sg_interface * sg_load(sg_input_callbacks callbacks)
sgsdl2_load_audio_fns(&_functions);
sgsdl2_load_graphics_fns(&_functions);
sgsdl2_load_image_fns(&_functions);
sgsdl2_load_pixbuf_fns(&_functions);
sgsdl2_load_input_fns(&_functions);
sgsdl2_load_text_fns(&_functions);
sgsdl2_load_util_fns(&_functions);
Expand Down
Loading