delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/12/12:18:21

From: swarsmatt AT aol DOT com (SWars Matt)
Newsgroups: comp.os.msdos.djgpp
Subject: More help with Jlib needed
Date: 11 Jul 1997 21:29:30 GMT
Lines: 34
Message-ID: <19970711212901.RAA22523@ladder02.news.aol.com>
NNTP-Posting-Host: ladder02.news.aol.com
Organization: AOL http://www.aol.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I have another question about the Jlib graphics library.  When I use the
image_save_pcx function, the .pcx file I get is always totally blank, with
just one color.  I wrote the following little program because I was having
problems with buff_draw_point in a more complicated program, and still I
get a blank image.

#include <jlib.h>
#include <malloc.h>

main()
{
char file[9] = "test.pcx";

screen_set_video_mode();
buffer_rec *buff = buff_init(640, 480);
UBYTE *paldef = pal_get_default();
 
int i;
for(i = 0; i < 480; i++)
buff_draw_point(*buff, i, i, 100);

int c = image_save_pcx(file, buff, paldef);
screen_blit_fs_buffer(buff);
buff_free(buff);
screen_restore_video_mode();		 
free(paldef);
return 0; 
}

Also, how can I keep the image on the screen for a while without using a
'do-nothing' loop before screen_restore_video_mode?
I realize these are probably stupid questions, but I am fairly new to
programming in general and C++ in particular.
Thanks for your help.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019