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

From: Matt Kris <jdkris AT alpha DOT delta DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: easy Allegro grahics help
Date: Tue, 16 Dec 1997 22:54:16 -0500
Organization: Delta College
Lines: 43
Message-ID: <34974CE7.421A@alpha.delta.edu>
NNTP-Posting-Host: pm109-04.dialip.mich.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm just tryin to write a simple program that lets you plot a pixel
under mode13h.  The problem is that when all is done I can't get it to
return back to text mode.

MaTT KRiS

/**********************************************************************
* Plot.c - Uses Allegro lib to set to plot a pixel                     
***********************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include "allegro.h"


/**********************************************************************
*  Main                                                                
**********************************************************************/

int main()
{

  int allegro_init();
  int color, x, y;

  printf("Enter a value from 1-320: ");
  scanf(" %d", &x);
  printf("Enter a value from 1-200: ");
  scanf(" %d", &y);

  // Set the video mode //
  set_gfx_mode(GFX_VGA, 320, 200, 0, 0);

  // Plots pixel //
  putpixel(screen,x,y,color);

  // Waits for a key to be pressed //
  while (!kbhit()){}

  // Right Here is where the help is needed

  return 0;
}

- Raw text -


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