🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #14375

problem with cb libgrx in djgpp

#14375
From: Norman C. Kluksdahl
Date: Sat, 09 Jan 1993 22:07
78 lines
2770 bytes
Can anyone help with this?
I am compiling some code with the GCC compiler from the djgpp project,
but I keep running into a bug.  This problem is evident on several 
different 386SX, 386, and 486 platforms, so I have discounted a problem
with my specific machine.

I am attempting to use the libgrx library mouse functions; specifically,
I am trying to use the queued keyboard and mouse interrupts, as directed
in the documentation for libgrx.  But, my problem is that even the test
program won't run, and neither will my own sample code.  If anyone can
help with this, I would be greatly appreciative.

****************  code compiled  **********************************

#include <grx.h>
#include <mousex.h>
#include <stdio.h>
#include <stdlib.h>

void main()
{
   GrSetMode(GR_width_height_color_graphics,x,y,c);
   mt();
   GrSetMode(GR_default_text);
   exit(0);
}

mt()
{
   MouseEvent evt;
   char ii = 0;
   FILE *fp, *fopen();
   fp = fopen("mt_int.out", "w");

   if(MouseDetect()) 
      {
      MouseEventMode(1);
      MouseInit();
      MouseDisplayCursor();
      MouseEventEnable(1,1);
      MouseSetColors(GrAllocColor(255,0,0),GrBlack());
      GrClearScreen(GrAllocColor(0,0,128));
      while(ii != 'q') 
	 {
	 MouseGetEvent((M_KEYPRESS | M_BUTTON_CHANGE | M_POLL ),&evt);
	 if(evt.flags & M_KEYPRESS) 
	    {
	    fprintf(fp,"key pressed = %c\n",evt.key);
	    ii = evt.key;
	    }
	 if(evt.flags & M_BUTTON_CHANGE)
	    {
	    if(evt.flags & M_LEFT_DOWN)
	       fprintf(fp,"left button down at %d %d\n",evt.x, evt.y);
	    if(evt.flags & M_LEFT_UP)
	       fprintf(fp,"left button up at %d %d\n",evt.x, evt.y);
	    if(evt.flags & M_MIDDLE_DOWN)
	       fprintf(fp,"middle button down at %d %d\n",evt.x, evt.y);
	    if(evt.flags & M_MIDDLE_UP)
	       fprintf(fp,"middle button up at %d %d\n",evt.x, evt.y);
	    if(evt.flags & M_RIGHT_DOWN)
	       fprintf(fp,"right button down at %d %d\n",evt.x, evt.y);
	    if(evt.flags & M_RIGHT_UP)
	       fprintf(fp,"right button up at %d %d\n",evt.x, evt.y);
	    }
	 }
      MouseUnInit();
   }
}

**********************  end of code  *************************

Thanks in advance for any help which can be provided.

=====================================================================
Norman Kluksdahl  
  moe@nuchat.sccsi.com
Technical Details
Message-ID: <1993Jan9.220734.6551@nuchat.sccsi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!nuchat!moe

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.ibm.pc,comp.sys.ibm.pc.programmer,gnu.gcc,gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!nuchat!moe
From: moe@nuchat.sccsi.com (Norman C. Kluksdahl)
Subject: problem with cb libgrx in djgpp
Message-ID: <1993Jan9.220734.6551@nuchat.sccsi.com>
Organization: South Coast Computing Services, Inc.
Date: Sat, 9 Jan 1993 22:07:34 GMT
Lines: 78