The simpleGL code sample uses pos to output its vertices.
I have searched the manuals and openGL lit, and can find only one
mention of this function: certainly no documentation. And trying
to adapt the function to my application by guessing and flailing is not working out.
Can anyone direct me to the code, or to documents for this
function?
Or to something more direct? Suppose you want to
make a few dots move around on the screen. In C and Pascal
you use gotoxy and it’s trivial.
Suppose you want to make a few dots move around on the screen.
Then you are in the completely wrong place.
I would recommend you go here http://www.libsdl.org/
In C and Pascal you use gotoxy and it’s trivial.
I’ve never heard of a standard “gotoxy” in C.
Graphics rarely are trivial.
Yeah, I knew that pos is an array - pardon me - it’s just that the line in simpleGL
that uses pos & make_float4 is labeled “write the vertex” or some such.
Really, no gotoxy in standard C? I wouldn’t know - it exists in my cheap C compiler download,
and works just like in Pascal. And there, it’s not what I’d call graphics - it’s just the simplest
imaginable screen addressing by character cell - not even by pixel.
Sorry, I wasn’t expecting a link to a page on arrays. I am still in need of
documentation on what is going on with the lines in sample code
that write vertices, using pos = make_float4
I need to simplify it and its addressing through the
dim3 structures and Idx.x’s and such, down to a creating several similar objects
whose position and motion I can write functions to control.
pos is used to transfer data from the graphics card to the ram.
From there it could be rendered, or something else.
No, I’ve never heard of a standard gotoxy. Since C must run on windows/linux/arm/other, gotoxy isn’t easily defined.
The is for example (n)curses if you wanna do that however.
But for pixels and drawing, grab an sdl tutorial.
I even have a ugly tic-tac-toe I wrote in SDL laying around somewhere if want an example. (But the tutorials are likely better)
I do believe there are ways of rendering directly from cuda too, but I never learned how.
What exactly is it that you want to do.
A float4 struct, and it’s corresponding make function looks like this:
/DEVICE_BUILTIN/
struct builtin_align(16) float4{
float x, y, z, w;
__cuda_assign_operators(float4)
};