Hello all

After closing a program, which releases priamry and super DFB
interface, I'm not able to open the fb again. Why could that be?

Source code attached.

Here is end of strace output from first run (releasing)...
-----------------------------------------------------------------------------------------
brk(0x80af000)                          = 0x80af000
write(1, "Font release\n", 13)          = 13
ioctl(3, FBIOPAN_DISPLAY, 0x8090b18)    = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [RTMIN], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
nanosleep({5, 0}, {5, 0})               = 0
write(1, "Releasing\n", 10)             = 10
munmap(0xb5d31000, 342764)              = 0
munmap(0xb5dea000, 22124)               = 0
munmap(0xb5df0000, 524288)              = 0
munmap(0xb5e70000, 12700)               = 0
kill(822, SIGRT_1)                      = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon
echo ...}) = 0
ioctl(5, KDSKBMODE, 0x1)                = 0
--- SIGRT_1 (Unknown signal 33) @ 0 (0) ---
wait4(820, NULL, __WCLONE, NULL)        = 820
_exit(0)                                = ?


Here is error, which I get when running again (have to reboot to make it run).
-----------------------------------------------------------------------------------------
/tmp $ ./test2

      ---------------------- DirectFB v0.9.25 ---------------------
            (c) 2000-2002  convergence integrated media GmbH
            (c) 2002-2004  convergence GmbH
       -----------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2006-08-10 13:00)
(*) Direct/Memcpy: Using SSE optimized memcpy()
(!) DirectFB/core/vt: Couldn't open neither `/dev/tty5' nor `/dev/vc/5'!
   --> No such file or directory
(!) DirectFB/Core: Could not initialize 'system' core!
   --> File not found!
Aborted
/tmp $

Don't know why it tries to open tty5 ... :-(


Any ideas?
#include <iostream>
#include <unistd.h>
#include <string>
#include <dfb++.h>

using namespace std;

int main( int argc, char *argv[] )
{
	DirectFB::Init( &argc, &argv );
	IDirectFB *m_dfb = DirectFB::Create();
	
	cout << "DFB initializad" << endl;

	IDirectFBSurface     *m_primary;
	DFBSurfaceDescription dsc;

	m_dfb->SetCooperativeLevel( DFSCL_FULLSCREEN );

	dsc.flags = DSDESC_CAPS;
	dsc.caps  = DSCAPS_PRIMARY ;

	DFB_ADD_SURFACE_CAPS( dsc.caps, DSCAPS_FLIPPING);
	DFB_ADD_SURFACE_CAPS( dsc.caps, DSCAPS_DOUBLE );

	m_primary = m_dfb->CreateSurface( dsc );

	cout << "Surface created" << endl;

	m_primary->Clear(150,150,200);
	m_primary->SetColor(255,0,0,0);
	m_primary->DrawLine(10,10,400,400);

	DFBFontDescription fontdsc;
	fontdsc.flags = DFDESC_HEIGHT;
	fontdsc.height = 30;

	m_primary->SetColor(0,255,255,0);

	string fontName("font.ttf");
	IDirectFBFont *font = m_dfb->CreateFont(fontName.c_str(),fontdsc);

	m_primary->SetFont(font);
	m_primary->DrawString("Hello hacka",11, 100,400,(DFBSurfaceTextFlags)0 );
	
	font->Release();

	cout << "Font release" << endl;	

	m_primary->Flip();

	sleep(5);

	cout << "Releasing" << endl;

	m_primary->Release();
	m_dfb->Release();	
	
	cout << "Primary and super interface released " << endl;

	return 23;
}


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to