sscore_graphics_win_d2d.h

Includes:

Introduction

The C interface to SeeScoreLib Direct2d graphics for Windows 8



Functions

sscore_graphics_create
sscore_graphics_dw_factory
sscore_graphics_fontname
sscore_graphics_numfonts
sscore_graphics_render_target

sscore_graphics_create


EXPORT sscore_graphics *sscore_graphics_create(
    ID2D1Factory *d2dfactory,
    IDWriteFactory *dwfactory,
    ID2D1RenderTarget *rt);  
Parameters
d2dfactory

a Direct2d factory used for creating lines and shapes to draw into the render target

dwfactory

a DirectWrite factory to handle score text

rt

a Direct2D Render Target into which the score will be drawn

Return Value

a graphics object to pass to sscore_system_draw


sscore_graphics_dw_factory


EXPORT IDWriteFactory *sscore_graphics_dw_factory(
    const sscore_graphics *graph);  
Parameters
graph

the graphics returned from sscore_graphics_create

Return Value

the DirectWrite factory


sscore_graphics_fontname


EXPORT const char *sscore_graphics_fontname(
    int index,
    char *buf,
    int buflen);  
Parameters
index

[0..numfonts-1] font index

buf

an allocated buffer to hold the returned font name

buflen

the size of the buffer

Return Value

a pointer to buf containing the font name

Discussion

copy font name for index into buf and return buf


sscore_graphics_numfonts


EXPORT int sscore_graphics_numfonts();  
Return Value

the number of fonts in the system


sscore_graphics_render_target


EXPORT ID2D1RenderTarget *sscore_graphics_render_target(
    const sscore_graphics *graph);  
Parameters
graph

the graphics returned from sscore_graphics_create

Return Value

the Direct2D Render Target