In <[EMAIL PROTECTED]>, Ville Syrj�l� wrote:
[Corrupt rectangles and no font with Matrox TV out]
> I have no such problems. Some code that demonstrates the problem would be
> nice.
The attached demonstrates both problems for me. I also noticed that the
Clear operation doesn't quite work properly either (with or without the
subsequent operations commented out): it leaves a grey rectangle across
the width of the screne at the bottom, with small darker dashes in it, a
bit like the way the other rectangles are drawn. I didn't describe that
problem very well BTW. What happens is, instead of neat rectangles with
a gap either side, they take up the whole width of the screen, but at
(approximately) the correct height, and they have small dashes of the
background colour in them, arranged in a diagonal pattern.
--
TH * http://www.realh.co.uk
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <directfb.h>
static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static int screen_width = 0;
static int screen_height = 0;
#define DFBCHECK(x...) \
{ \
DFBResult err = x; \
\
if (err != DFB_OK) \
{ \
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
DirectFBErrorFatal( #x, err ); \
} \
}
static IDirectFBFont *font = NULL;
static char *text = "DirectFB rulez!";
int main (int argc, char **argv)
{
DFBFontDescription font_dsc;
DFBSurfaceDescription dsc;
DFBCHECK (DirectFBInit (&argc, &argv));
DFBCHECK (DirectFBCreate (&dfb));
DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary));
DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height));
font_dsc.flags = DFDESC_HEIGHT;
font_dsc.height = 48;
DFBCHECK (dfb->CreateFont (dfb,
"/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
&font_dsc, &font));
DFBCHECK (primary->SetFont (primary, font));
DFBCHECK (primary->Clear (primary, 0, 0, 0x0, 0xFF));
DFBCHECK (primary->SetColor (primary, 0xff, 0, 0, 0xff));
DFBCHECK (primary->FillRectangle (primary, 76, 76, 568, 32));
DFBCHECK (primary->SetColor (primary, 0xff, 0xff, 0x80, 0xff));
DFBCHECK (primary->DrawString (primary, text, -1, 100, 200, DSTF_LEFT));
DFBCHECK (primary->SetColor (primary, 0xff, 0xff, 0, 0xff));
DFBCHECK (primary->FillRectangle (primary, 76, 400, 568, 32));
DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC));
sleep (10);
font->Release (font);
primary->Release (primary);
dfb->Release (dfb);
return 0;
}
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users