el baño es sólo para niñas
I've tried doing this with having the setup and creation functions out of the class; just so I can have a practise. but am running into a few probs.
#include <windows.h>
#include <tinyptc_ext.h> // remember ( ALT+F7) to add linker -> input -> dependencies 'libmmx.lib' & 'libtinyptc_ext.lib'
const int XRES=640;
const int YRES=480;
const int ARES=XRES*YRES;
class gfx_buffer
{
private:
int wwidth, height;
int wwidth2, height2;
unsigned int *pixels;
}
// funksters.
//void draw_gfx_buffer( gfx_buffer *dest, gfx_buffer *srce, int x, int y );
gfx_buffer* create_gfx_buffer( int wwidth, int height );
int set_graphics( int wwidth, int height );
gfx_buffer *screen_buffer=create_gfx_buffer( XRES, YRES );
//screen_buffer=create_gfx_buffer( 640, 480 );
int main()
{
set_graphics( XRES, YRES );
while (1)
{
// clear screen.
// render to the screen buffer.
ptc_update( screen_buffer->pixels[0] );
} // wend.
} // end function.
gfx_buffer *create_gfx_buffer( int wwidth, int height )
{
gfx_buffer *buffer = new gfx_buffer;
buffer->pixels = new unsigned int [ wwidth * height ];
buffer->wwidth=wwidth;
buffer->height=height;
buffer->wwidth2=wwidth/2;
buffer->height2=height/2;
return buffer;
}
//void set_pixel()
//{
//}
int set_graphics( int wwidth, int height )
{
ptc_allowclose(1);
ptc_setflip(1);
ptc_setdialog(1,"Would You Prefer Fullscreen Dude?",1,0);
if (!ptc_open("mOnKeY bUiSnEsS 1",wwidth,height)) return 1;
return 0;
}
Many thanks in advance,
Clyde.