Exemple #1
0
// Try open file stream
bool FXGZFileStream::open(const FXString& filename,FXStreamDirection save_or_load,FXuval size)
{
    FXERRHM(myfile=new QFile(filename));
    QGZipDevice *d;
    FXERRHM(d=new QGZipDevice(myfile));
    setDevice(d);
    if(save_or_load==FXStreamLoad)
    {   // Open for read
        d->open(IO_ReadOnly);
    }
    else
    {   // Open for write
        d->open(IO_WriteOnly);
    }

    // Do the generic book-keeping
    return FXStream::open(save_or_load, size);
}
Exemple #2
0
	FXGLCircleSource() : FXGLVertices(0,0,0, VERTICES_LINES|VERTICES_LOOPLINES|VERTICES_NODEPTHTEST), vertices(0)
	{
		static const FXuint no=128;
		FXERRHM(vertices=new FXVec3f[no]);
		for(FXuint n=0; n<no; n++)
			vertices[n]=FXVec3f(sin((float)PI*2/no*n), cos((float)PI*2/no*n), 0);
		setVertices(vertices, no);
		setLineSize(0.1f);
		setColor(FXGLColor(0,0,0));
	}