From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- .../src/modules/engines/direct3d/evas_engine.h | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 libraries/evas/src/modules/engines/direct3d/evas_engine.h (limited to 'libraries/evas/src/modules/engines/direct3d/evas_engine.h') diff --git a/libraries/evas/src/modules/engines/direct3d/evas_engine.h b/libraries/evas/src/modules/engines/direct3d/evas_engine.h new file mode 100644 index 0000000..da1ebff --- /dev/null +++ b/libraries/evas/src/modules/engines/direct3d/evas_engine.h @@ -0,0 +1,125 @@ +#ifndef __EVAS_ENGINE_H__ +#define __EVAS_ENGINE_H__ + + +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVAS_INLINE_ARRAY_H // We dont need that and it is buggy + +#include "evas_common.h" + +#ifdef __cplusplus +} +#endif + + +//#define ENABLE_LOG_PRINTF + +extern int _evas_engine_direct3d_log_dom ; +#ifdef ERR +# undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_direct3d_log_dom, __VA_ARGS__) + +#ifdef DBG +# undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_direct3d_log_dom, __VA_ARGS__) + +#ifdef INF +# undef INF +#endif +#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_direct3d_log_dom, __VA_ARGS__) + +#ifdef WRN +# undef WRN +#endif +#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_direct3d_log_dom, __VA_ARGS__) + +#ifdef CRIT +# undef CRIT +#endif +#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_direct3d_log_dom, __VA_ARGS__) + +#ifdef ENABLE_LOG_PRINTF +#define Log(str, ...) INF("D3D "str, __VA_ARGS__) +#else +#define Log(str, ...) +#endif + +typedef void * Direct3DDeviceHandler; +typedef void * Direct3DImageHandler; +typedef void * Direct3DFontGlyphHandler; + + +#ifdef __cplusplus +extern "C" { +#endif + +// Main engine functions + +Direct3DDeviceHandler evas_direct3d_init(HWND window, int depth, int fullscreen); +void evas_direct3d_free(Direct3DDeviceHandler d3d); +void evas_direct3d_render_all(Direct3DDeviceHandler d3d); +void evas_direct3d_resize(Direct3DDeviceHandler d3d, int width, int height); +void evas_direct3d_set_fullscreen(Direct3DDeviceHandler d3d, + int width, int height, int fullscreen); +void evas_direct3d_set_layered(Direct3DDeviceHandler d3d, int layered, + int mask_width, int mask_height, unsigned char *mask); + + +// Context manipulations + +void evas_direct3d_context_color_set(Direct3DDeviceHandler d3d, int r, int g, int b, int a); +void evas_direct3d_context_set_multiplier(Direct3DDeviceHandler d3d, int r, int g, int b, int a); + +// Simple objects + +void evas_direct3d_line_draw(Direct3DDeviceHandler d3d, int x1, int y1, int x2, int y2); +void evas_direct3d_rectangle_draw(Direct3DDeviceHandler d3d, int x, int y, int w, int h); + +// Images + +Direct3DImageHandler evas_direct3d_image_load(Direct3DDeviceHandler d3d, + const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo); +Direct3DImageHandler evas_direct3d_image_new_from_data(Direct3DDeviceHandler d3d, + int w, int h, DWORD *image_data, int alpha, int cspace); +Direct3DImageHandler evas_direct3d_image_new_from_copied_data(Direct3DDeviceHandler d3d, + int w, int h, DWORD *image_data, int alpha, int cspace); +void evas_direct3d_image_free(Direct3DDeviceHandler d3d, Direct3DImageHandler image); +void evas_direct3d_image_data_put(Direct3DDeviceHandler d3d, Direct3DImageHandler image, + DWORD *image_data); +void evas_direct3d_image_data_get(Direct3DDeviceHandler d3d, Direct3DImageHandler image, + int to_write, DATA32 **image_data); +void evas_direct3d_image_draw(Direct3DDeviceHandler d3d, Direct3DImageHandler image, + int src_x, int src_y, int src_w, int src_h, + int dst_x, int dst_y, int dst_w, int dst_h, int smooth); +void evas_direct3d_image_size_get(Direct3DImageHandler image, int *w, int *h); +void evas_direct3d_image_border_set(Direct3DDeviceHandler d3d, Direct3DImageHandler image, + int l, int r, int t, int b); +void evas_direct3d_image_border_get(Direct3DDeviceHandler d3d, Direct3DImageHandler image, + int *l, int *r, int *t, int *b); + +// Fonts + +Direct3DFontGlyphHandler evas_direct3d_font_texture_new(Direct3DDeviceHandler d3d, + RGBA_Font_Glyph *fg); +void evas_direct3d_font_texture_free(Direct3DFontGlyphHandler ft); +void evas_direct3d_font_texture_draw(Direct3DDeviceHandler d3d, void *dest, void *context, + RGBA_Font_Glyph *fg, int x, int y); +void evas_direct3d_select_or_create_font(Direct3DDeviceHandler d3d, void *font); +void evas_direct3d_font_free(Direct3DDeviceHandler d3d, void *font); + +#ifdef __cplusplus +} +#endif + + +#endif /* __EVAS_ENGINE_H__ */ -- cgit v1.1