CompuServe Thread

#Why doesn't this work?

5 messages in this thread
#132182From: Alfonso HermidaOct 30, 1994 2:20 PM
I modified BOX.C in order to test some of the gfx functions….the code compiles OK but doesn't work. The purpose is to erase the screen, wait for a key and then redraw…that's it. Any ideas? ///////////////////////////////////// #include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> #include "pxp.h" #include "exprtn.h" /* Variable definitions */ #define COLOR 1 /************************/ /* Dialog description */ DlgEntry cdialog[]= { /* Text strings to be displayed in dialog box */ 0, "TITLE=\"Test\"", 0, "TITLE=\"by John Doe, Version 1.0\"", /* Setup for 'radio-button' and associated variable */ COLOR, "RADIO=\"AXP Color:\", \"Default\", \"From Object\"", 0, NULL }; /* Version test value */ /* Every external process must have a unique version number */ #define VERSION 0x71FF /* State Structure definition */ /* Any variables whose values are set via dialog interface must be declared within the 'State' struct. */ typedef struct { ulong version; int obj_color; } State; static State init_state = { VERSION, 1 }; /* initial state settings */ static State state = { VERSION, 1 }; /* default settings */ static int ix, thismtl; static float minx, miny, minz, maxx, maxy, maxz; /*—————————————————————-*/ /* Following function sets the appropriate 'State' variables based on the input from the dialog */ void ClientSetStateVar(int id, void *ptr) { OVL o; /* Union of possible values that the dialog can return */ ulong *ul; char *s; ul=(ulong *)ptr; s=(char *)ptr; o.ul = *ul; switch(id) { case COLOR: state.obj_color=o.i; break; /* State variables set here based on Union variable */ } } /* Following function sets the appropriate value of the Union 'OVL' variable to return values stored in the 'State' variable */ ulong ClientGetStateVar(int id) { OVL o; /* Union of the values which can be requested by 3D Studio from the 'State' structure */ switch(id) { case COLOR: o.i=state.obj_color; break; /* Union variable set to appropriate value from 'state' variable */ } return(o.ul); /* The variable requested by 3D Studio is returned to 3D Studio via the 'ulong' field of the 'Union' structure 'OVL'. */ } /* Following function allows 3D Studio to determine the size of any variable in the dialog */ int ClientVarSize(int id) { return(1); } /* Following function allows 3D Studio to determine the size of the 'State' structure and returns a pointer to the 'State' struct */ char *ClientGetState(int *size) { *size = sizeof(State); return((char *)&state); } /* Following function allows 3D Studio to reset the state of the external process */ void ClientResetState() { state = init_state; } /* Following function performs any calculations or packet-commands necessary before the EXP can begin */ void ClientStartup(EXPbuf *buf) { buf->opcode=EXP_NOP; /* Packet command sent to 3D Studio */ buf->usercode=0x0200; buf->status=1; } /* Following function contains user codes which process data */ void ClientUserCode(EXPbuf *buf) { switch(buf->usercode) { case 0x0200: gfx_clearscreen(); gfx_key_wait(ix); gfx_redraw(); buf->opcode=buf->usercode=EXP_TERMINATE; buf->status=0; break; } } void ClientTerminate(void) { /* free any data structures, etc. */ } DlgEntry *ClientDialog(int n) { return(&cdialog[n]); }
#132234From: Jonas Ruikis [ADESK]Oct 30, 1994 8:11 PM
Hi Alfonso, << what's wrong with the code..?? I'm sick and I won't be in work until Tuesday to test this.. << gfx_key_wait(ix); >> Are you using the same calls found in mouser.zip from the software dev kit section? Why don't you modify that piece of code and add your clear screen? jonas[adesk]
#132235From: Alfonso HermidaOct 30, 1994 8:27 PM
//Hi Alfonso, //<< what's wrong with the code..?? //I'm sick and I won't be in work until Tuesday to test this.. don't worry about it – take care of yourself first. //<< gfx_key_wait(ix); >> //Are you using the same calls found in mouser.zip from the software dev kit section? //Why don't you modify that piece of code and add your clear screen? I'll check the code – thanks for letting me know. Alfonso
#132300From: Alfonso HermidaOct 31, 1994 6:07 AM
BTW, I'm using Watcom 10.0. I also use clib3s.lib from version 9.5 because the one from 10.0 doesn't work with the IPAS kit. Mike Tsoupko compiled the code with 9.5 and he says that there were no problems with it! (I've tried to get version 9.5 but Watcom wants me to pay the full price even though I already have 10.0.) Alfonso
#132333From: Jonas Ruikis [ADESK]Oct 31, 1994 9:18 AM
<< 10.0 vs. 9.5 >> There are differences between the two compilers. Autodesk will only support 9.5 Watcom with IPAS3. jonas[adesk]