/* dfb includes */
#include <directfb.h>
+#include "dfb_api.h"
+
#define MY_FONT_HEIGHT 18
/* global stuff */
char dfb_image[]="./images/ivac_logo.png";
char dfb_font[]="./fonts/decker.ttf";
-/* small api - directfb usage kinda sux: foo->bar(foo,...) wtf?!?!?! */
+/* variable definitions */
+// struct user_info {
+
+
+/* functions */
int dfb_init(int *argc,char **argv) {
DirectFBInit(argc,&argv);
image_provider->Release(image_provider);
return 1;
}
-
+
int create_video_surface(void) {
DFBSurfaceDescription desc;
DFBVideoProviderCapabilities caps;
video_provider->GetCapabilities(video_provider,&caps);
printf("video capabilities: %x\n",caps);
dfb->CreateSurface(dfb,&desc,&video);
- video_provider->PlayTo(video_provider,video,NULL,NULL,NULL);
+ video_provider->PlayTo(video_provider,video,NULL,video_callback,NULL);
video_provider->Release(video_provider);
return 1;
}
int blit_video(void) {
int x,y;
get_surface_size(video,&x,&y);
- blit_surface(video,((screen_width-x)/2),((screen_height-y)/2));
+ printf("size of logo width/height: %d/%d\n",x,y);
+ // blit_surface(video,((screen_width-x)/2),((screen_height-y)/2));
+ blit_surface(video,0,0);
return 1;
}
return 1;
}
+DVFrameCallback video_callback(void) {
+ primary->StretchBlit(primary,video,NULL,NULL);
+ // flip_it;
+ return DFENUM_OK;
+}
+
/* test api app */
int main (int argc, char **argv) {
create_primary_surface();
- // create_video_surface();
- create_logo_surface();
+ create_video_surface();
+ // create_logo_surface();
get_primary_surface_size();
printf("primary surface width/height: %d/%d\n",screen_width,screen_height);
clear_screen(primary);
- blit_logo();
+ puts("main: blit video");
+ blit_video();
+ // blit_logo();
- flip_it();
+ // puts("main: flip");
+ // flip_it();
sleep(10);