Bug in my proggie

Search this archive.

From: viscous liquid (viscous_liquid@yahoo.com)
Date: Fri 22 Dec 2000 - 15:56:04 IST


Hey all,
   I was wondering if any of you could tell  me where
my flaw is in the following source code.  The reason I
say there is a flaw is because after the souce
compiles I can't get it to display right.

// CODE //

typedef struct _ViewPort {
    int width,height;
    int *ytable;
    char *data;
} ViewPort;

ViewPort *c_port;  //Global var, initialized elsewhere


void set_pixel(int x, int y, int c) {
    c_port->data[c_port->ytable[y] + x] = c;
}

Later on, "c_port->data" is copied to the screen with
gl_putbox(),but here's the kicker.  When I copy to the
screen I dont, get anything.  So to find the bug I
wrote some dump routines for the ViewPort struct and
come to find out that after call my set_pixel funct,
and then dump the contents of "c_port->data"  nothing
has been changed.  Thus it is left as I have
initialized it, with all zeros.  This is more of a C
codeing problem than SVGAlib problem but since I am
using SVGAlib I figure you all could help me.

BTW, If you would like to see more of the source let
me know and I can send more, I am justing trying to
keep this message short.

Thanks,
Daniel Smith, SN(USN)



__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST