Err, this all works now. Please ignore my last message. I'm an idiot.<br><br><div class="gmail_quote">On Thu, Apr 16, 2009 at 9:00 PM, lowly coder <span dir="ltr"><<a href="mailto:lowlycoder@huoyanjinjing.com">lowlycoder@huoyanjinjing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Here's some C code:<br><br>int num_textures = 10;                                                                   <br>


int textures[10];                                                                        <br>glGenTextures(10, textures);         <br><br><br>here's the current binding for gl/GenTextures:<br>(define gl/GenTextures (c-lambda ( GLsizei GLuint* ) void "glGenTextures"))<br>

<br>Now, what I'd like to do is:<br><br>(define textures (make-u32vector 10))   <br><br>and pass 'textures' to gl/GenTextures :<br><br>A very smart friend suggested:<br><br>(define gl/GenTextures2 (c-lambda ( GLsizei scmobj ) void "glGenTextures(___arg1,___CAST(int*,&___FETCH_U32(___BODY(___arg2),___INT(0)));"))<br>

<br>$ ...<br>*** ERROR IN ".../gl.scm"@515.45 -- Undefined C type identifier<br><br>boo, probably due to scmobj; just to test that, let's change it to:<br><br>(define gl/GenTextures2 (c-lambda ( GLsizei GLuint* ) void "glGenTextures(___arg1,___CAS\<br>

T(int*,&___FETCH_U32(___BODY(___arg2),___INT(0)));")) <br><br>$ ...<br>gl.c: In function ‘long int ___H__20_gl_2e_o1(___processor_state_struct*)’:<br>gl.c:23068: error: invalid operands of types ‘unsigned int*’ and ‘int’ to binary ‘operator&’<br>

*** ERROR IN "ll.scm"@29.1 -- C compilation or link failed while compiling "gl"<br><br>yay, we now get a different error<br><br>so the 'scmobj' is the undefined type, but I don't know what to change it to; grepping through gambit-c.txt, there are a few entries of "scmobj" lying around (but it's embeeded in compilcated C code, and I'm not sure what the alternative should be).<br>

<br>so ... what should I change this scmobj to?<br><br>thanks!<br>
</blockquote></div><br>