Search:

Type: Posts; User: joed

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    15
    Views
    5,030

    this was a huge help, thanks...

    this was a huge help, thanks...
  2. Replies
    15
    Views
    5,030

    programming jobs/colleges

    I want to get a job in programming, not necessarily the highest paying but something I would enjoy. I've thought about schools, but I'm limited to going at night since I work 9-5 and have a mortgage,...
  3. Replies
    3
    Views
    1,619

    Double is the return type, you don't need it in...

    Double is the return type, you don't need it in the program. Just do pow(a, b).
  4. Replies
    53
    Views
    22,754

    You might be better off. :)

    You might be better off. :)
  5. Replies
    53
    Views
    22,754

    Wrote Rendera (http://www.rendera.net) entirely...

    Wrote Rendera entirely from scratch in C. Might be a bit dated, but does most of what I wanted. There were many gotchas along the way, I have a lot of respect for people writing graphics apps now.
  6. Replies
    3
    Views
    1,958

    Skip the function pointers, you don't need them...

    Skip the function pointers, you don't need them if calling the same function always. I meant only to read up on the subjects, not to use the examples outright.
  7. Replies
    3
    Views
    1,958

    Read up on structures and type definitions....

    Read up on structures and type definitions. You'll most likely end up with an array of 200 instrument structures, an array of output values, and a few simple support functions.

    You can fill arrays...
  8. Thread: memcpy() faster?

    by joed
    Replies
    18
    Views
    18,471

    Sorry, I did it wrong: movl _buf, %eax...

    Sorry, I did it wrong:



    movl _buf, %eax
    pushl %ebp
    movl %eax, _a
    movl %esp, %ebp
    movl _buf+4, %eax
    popl %ebp
  9. Thread: memcpy() faster?

    by joed
    Replies
    18
    Views
    18,471

    I'm stupid :)

    I'm stupid :)
  10. Thread: Declare float

    by joed
    Replies
    10
    Views
    1,814

    What's the actual problem, are you testing for...

    What's the actual problem, are you testing for equality? Maybe try seeing if the values are close enough instead:



    #include <math.h>

    int close(float a, float b)
    {
    if(fabsf(a - b) <...
  11. Replies
    20
    Views
    2,442

    This should be right, if not, lemme know. I tried...

    This should be right, if not, lemme know. I tried to shorten in a bit. Supposedly this can be modified to do ovals but I've not tried it.



    void circle(int x, int y, int r)
    {
    r++;

    int...
  12. Replies
    20
    Views
    2,442

    Just for fun, here's an easy way to draw circles,...

    Just for fun, here's an easy way to draw circles, adapted from "8088 Macro Assembler Programming" by Dan Rollins. Could be shortened/optimized a bit:



    void circle(int x, int y, int r)
    {
    int...
  13. Replies
    4
    Views
    3,653

    There can be many reasons, but usually the...

    There can be many reasons, but usually the pointer wasn't NULL before using malloc. Do a couple of checks like this:



    // example pointer
    int *p;

    // free dangling pointer
    if(p)
    free(p);
  14. Thread: free art program

    by joed
    Replies
    5
    Views
    2,596

    It's mostly portable, but I don't have a Mac, and...

    It's mostly portable, but I don't have a Mac, and don't want to freebie the code. I will keep it in mind though.

    BTW there was a pretty bad bug in the undo system, might want to d/l the file again.
  15. Thread: free art program

    by joed
    Replies
    5
    Views
    2,596

    Download URL may have been wrong. Fixed now.

    Download URL may have been wrong. Fixed now.
  16. Thread: free art program

    by joed
    Replies
    5
    Views
    2,596

    free art program

    Get Rendera at:
    http://www.joefus.com

    Written in C, using free software tools like vim/mingw, and MS HtmlHelp. The program could really use antialiasing, hopefully next version. Have fun!
  17. Thread: Clickable line

    by joed
    Replies
    4
    Views
    1,490

    After the bounds check, this might work for the...

    After the bounds check, this might work for the line test (untested).
    x1, y1 and x2, y2 are the line endpoints:



    dx1 = abs(mousex - x1);
    dx2 = abs(mousex - x2);
    dy1 = abs(mousey - y1);
    dy2...
  18. Thread: Pointers trouble

    by joed
    Replies
    39
    Views
    4,421

    even = !(side & 1); sorry!

    even = !(side & 1);


    sorry!
  19. Thread: Pointers trouble

    by joed
    Replies
    39
    Views
    4,421

    You have to create the array to begin with: ...

    You have to create the array to begin with:



    int array[25 * 25];


    Here's a start:
  20. try ensuring the pointers are appropriately dead...

    try ensuring the pointers are appropriately dead or active before using malloc or free:



    int *p;

    if(!p)
    malloc...

    if(p)
  21. Replies
    10
    Views
    1,376

    A while back I got "Windows 98 Programming from...

    A while back I got "Windows 98 Programming from the Ground Up". Overall the book wouldn't be great, but the examples are in straight C, and work with mingw. Complete listings (including resource...
  22. Thread: 64-bit quantaties

    by joed
    Replies
    3
    Views
    1,131

    I think "long long" is the long-long-winded, yet...

    I think "long long" is the long-long-winded, yet correct choice. Might as well typedef it away.
  23. Replies
    9
    Views
    1,557

    I think you're confusing C's function calls with...

    I think you're confusing C's function calls with BASIC's goto command. Put the switch statement in a while loop that tests for a quit condition:



    while(!quit) {
    do stuff, set quit = 1...
  24. Replies
    15
    Views
    35,683

    Try this Bresenham, it's identical to MS-Paint...

    Try this Bresenham, it's identical to MS-Paint except for a slight difference when lines are drawn backwards.



    void line(int x1, int y1, int x2, int y2, int color)
    {
    int dx, dy, inx, iny, e;...
  25. Replies
    6
    Views
    1,960

    Why return an unsigned char instead of just...

    Why return an unsigned char instead of just "int"? Also, bitmap data can probably also be declared "int", since any math performed would usually be done on the extracted bytes. I use these macros...
Results 1 to 25 of 61
Page 1 of 3 1 2 3