Search:

Type: Posts; User: Kernel Sanders

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,760

    Sorry for the late reply - this was due a while...

    Sorry for the late reply - this was due a while ago :D

    Thanks for the suggestions all
  2. Replies
    9
    Views
    2,760

    Those are integers, so it makes the values in the...

    Those are integers, so it makes the values in the texture go up in steps. For example, if RED_STEP is 14, 0-13 maps to 0, 14-27 maps to 14, 28-41 maps to 28, etc.

    I changed the 3 to GL_RGB, but...
  3. Replies
    9
    Views
    2,760

    Creating OpenGL Texture

    I'm writing a pixel shader for a class, and the final step is to use a 1D texture to map whatever color the fragment would be under phong shading to another color to produce a banding effect. When I...
  4. Replies
    5
    Views
    1,563

    Wouldn't I just get a short count? I...

    Wouldn't I just get a short count?



    I already wrote the wrappers, I just have to test the things. When read/write return normally everything works, but I have to test how the wrappers behave...
  5. Replies
    5
    Views
    1,563

    How to generate read/write errors?

    I wrote assembly wrappers for read/write system calls for an embedded lab, and now I need to test how it handles errors. How can I generate errors in read/write calls? Short counts I can do, but I...
  6. Replies
    6
    Views
    6,688

    Finally found a solution. There needs to be a ...

    Finally found a solution. There needs to be a


    _errno
    .word errno

    block. _errno is then synonymous with the address of the external symbol errno. It worked as described, you just...
  7. Replies
    6
    Views
    6,688

    Well it's assembly so you don't declare variables...

    Well it's assembly so you don't declare variables as such. We've tried


    EXTERN errno
    EXTERN errno
    extern errno

    Google dug all three up. All gave the error
  8. Replies
    6
    Views
    6,688

    I unfortunately need to work within the confines...

    I unfortunately need to work within the confines of the lab. There are errno.h and errno.c which declare and initialize errno, we just have to write read.S, which must set the already declared...
  9. Replies
    6
    Views
    6,688

    Extern variables in GAS?

    For my embedded systems course we are writing assembly wrappers for syscalls. When in error we need to set the global errno (defined in the class's own files not the normal libc) as expected. How...
  10. Replies
    4
    Views
    1,157

    Question About Scope

    As a C programmer doing C++ stuff a few things are still confusing to me. One is scope. Consider the following code


    #include <vector>
    using std::vector;

    class A_Class{
    public:
    ...
  11. Replies
    5
    Views
    14,473

    I see. Thank you

    I see. Thank you
  12. Replies
    5
    Views
    14,473

    O1 and O2 do the same thing Really? The...

    O1 and O2 do the same thing



    Really? The 32x4 signed is the example the gcc manual uses (page 332).


    typedef int v4si __attribute__ ((vector_size (16)));
    v4si a, b, c;
    c = a + b;
  13. Replies
    5
    Views
    14,473

    GCC and SSE multplication

    I'm trying to get the hand of using SSE instructions through gcc, and I can't get multiplication to work.

    Here is my code and my Makefile

    simd.c

    #include <stdio.h>
    #include <stdlib.h>
    ...
  14. Replies
    7
    Views
    1,853

    I found the problem, and it was a pretty common...

    I found the problem, and it was a pretty common one. Apparently the programmer (me) is an idiot. It works fine even without the extern C declaration - there was a standard library that the given...
  15. Replies
    7
    Views
    1,853

    Not mixing C code with C++ code, using a gcc...

    Not mixing C code with C++ code, using a gcc compiled C library in a g++ compiled C++ program
  16. Replies
    7
    Views
    1,853

    C library in C++ program?

    I'm writing a program for class, and given the task (it's a computer graphics class) C++ is much easier to work with. I have everything ported and compiling in C++, but the instructors gave us a...
  17. Replies
    9
    Views
    6,882

    sin(2x) = 2*sin(x)*cos(x) 9/16 = cos(x) / (2 *...

    sin(2x) = 2*sin(x)*cos(x)

    9/16 = cos(x) / (2 * sin(x) * cos(x))
    9/8 = 1/sin(x)
    sin(x) = 8/9
    x = arcsin(8/9)
  18. Replies
    28
    Views
    4,974

    With few exceptions all valid C code is valid C++...

    With few exceptions all valid C code is valid C++ code, so no, there is nothing that C can do that C++ can't. When people call C low level it is in comparison to languages like perl or java or...
  19. Replies
    5
    Views
    2,791

    Change for (ii = 0; ii

    Change


    for (ii = 0; ii<max_i+1; ++ii)
    {
    for (jj = 0; jj<max_j+1; ++jj)


    to
  20. Replies
    3
    Views
    1,114

    It won't print anything until it hits eof. ...

    It won't print anything until it hits eof. Hitting enter just gives it more and more newlines, which it parses before asking for another character

    Control-D = eof when inputting via command line
  21. Replies
    7
    Views
    27,163

    Declare it as a 'double **' instead of a 'double...

    Declare it as a 'double **' instead of a 'double [][]'

    The syntax for accessing the elements is identical

    I would also suggest returning -1 or something similar if the 'i==j==2' fails instead...
  22. Off topic - can you recommend a good reference...

    Off topic - can you recommend a good reference for C++'s const keyword? As a C programmer learning C++ const is one of my stumbling blocks
  23. string s("whatever"); char *cs = s.c_str(); ...

    string s("whatever");
    char *cs = s.c_str();

    Google is your friend :)
  24. Append with the += operator and convert it to a C...

    Append with the += operator and convert it to a C string char * with the c_str() function
  25. Replies
    14
    Views
    2,048

    It would depend on the hardware, but a 256 byte...

    It would depend on the hardware, but a 256 byte array can easily fit into a cache, so I'd have to guess that reading would be faster. I'm not sure what effect the addition of a branch would have...
Results 1 to 25 of 61
Page 1 of 3 1 2 3