projects
/
my-code
/
ivac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
20861b5
)
-
author
hackbard
<hackbard>
Sun, 9 Feb 2003 22:37:16 +0000
(22:37 +0000)
committer
hackbard
<hackbard>
Sun, 9 Feb 2003 22:37:16 +0000
(22:37 +0000)
dfb_api.c
patch
|
blob
|
history
diff --git
a/dfb_api.c
b/dfb_api.c
index
7435ad4
..
56534e3
100644
(file)
--- a/
dfb_api.c
+++ b/
dfb_api.c
@@
-9,7
+9,7
@@
/* dfb includes */
#include <directfb.h>
/* dfb includes */
#include <directfb.h>
-#define MY_FONT_HEIGHT
4
8
+#define MY_FONT_HEIGHT
1
8
/* global stuff */
/* global stuff */
@@
-22,24
+22,27
@@
static int screen_height = 0;
static IDirectFBSurface *logo = NULL;
static IDirectFBFont *font = NULL;
static IDirectFBSurface *logo = NULL;
static IDirectFBFont *font = NULL;
-static char *text_top="Internet Video / Audio Conferencing"
+static char *text_top="Internet Video / Audio Conferencing"
;
/* image to load */
char dfb_image[]="./images/ivac_logo.png";
/* image to load */
char dfb_image[]="./images/ivac_logo.png";
+/* font to use */
+char dfb_font[]="./fonts/decker.ttf";
int main (int argc, char **argv) {
int main (int argc, char **argv) {
- int i;
- DFBFontDescription font_d
e
sc;
+ int i
,font_width
;
+ DFBFontDescription font_dsc;
DFBSurfaceDescription dsc;
/* image provider */
IDirectFBImageProvider *provider;
/* init */
DFBSurfaceDescription dsc;
/* image provider */
IDirectFBImageProvider *provider;
/* init */
- DirectFBInit
(&argc,
&argv);
- DirectFBCreate
(&dfb);
- dfb->SetCooperativeLevel
(dfb, DFSCL_FULLSCREEN);
+ DirectFBInit
(&argc,
&argv);
+ DirectFBCreate(&dfb);
+ dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);
dsc.flags=DSDESC_CAPS;
dsc.flags=DSDESC_CAPS;
- dsc.caps=DSCAPS_PRIMARY | DSCAPS_FLIPPING;
+ // dsc.caps=DSCAPS_PRIMARY | DSCAPS_FLIPPING;
+ dsc.caps=DSCAPS_PRIMARY;
dfb->CreateSurface(dfb,&dsc,&primary);
primary->GetSize(primary,&screen_width,&screen_height);
printf("debug: w/h = %d / %d\n",screen_width,screen_height);
dfb->CreateSurface(dfb,&dsc,&primary);
primary->GetSize(primary,&screen_width,&screen_height);
printf("debug: w/h = %d / %d\n",screen_width,screen_height);
@@
-58,20
+61,32
@@
int main (int argc, char **argv) {
/* create font */
font_dsc.flags=DFDESC_HEIGHT;
font_dsc.height=MY_FONT_HEIGHT;
/* create font */
font_dsc.flags=DFDESC_HEIGHT;
font_dsc.height=MY_FONT_HEIGHT;
-
+ dfb->CreateFont(dfb,dfb_font,&font_dsc,&font);
+
+ /* set font */
+ primary->SetFont(primary,font);
+ font->GetStringWidth(font,text_top,-1,&font_width);
- /* slide logo */
+ /* slide logo
+ write text_top
*/
for(i = -dsc.width; i < screen_width; i++) {
/* clear screen */
primary->FillRectangle(primary,0,0,screen_width,screen_height);
for(i = -dsc.width; i < screen_width; i++) {
/* clear screen */
primary->FillRectangle(primary,0,0,screen_width,screen_height);
+ /* write text */
+ primary->SetColor(primary,0x0,0x0,0x0,0xff);
+ primary->DrawString(primary,text_top,-1,(screen_width/2)-(font_width/2),
+ screen_height/4,DSTF_LEFT);
+
/* blit image */
primary->Blit(primary,logo,NULL,i,(screen_height-dsc.height)/2);
/* flip */
primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
/* blit image */
primary->Blit(primary,logo,NULL,i,(screen_height-dsc.height)/2);
/* flip */
primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
- }
+ }
+
+ /* release font */
+ font->Release(font);
/* release image */
logo->Release(logo);
/* release image */
logo->Release(logo);