pos[] what is it? is there anything simpler?

Greetings,

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.

WHAT do you do in openGL/cuda?

thanks

clanz
lanzcc@potsdam.edu

pos is not a function, and it is not “used to output”. It’s an array, it’s data transport.

Can anyone direct me to the code, or to documents for this function?
http://gd.tuwien.ac.at/languages/c/program…brown/c_034.htm

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.

Thanks for the info - this is just what I needed.

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.

Anyway, thanks again!

WHOA WAIT

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.

Haha, sorry. You called arrays funtions, that made me assume things ^^

make_float4 just takes 4 floats and puts then in a float4 struct.

That’s trivial.

I still don’t understand what you are asking, or what you want to do.

Please be more specific.

I’ll phrase the float4 answer better.

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)
};

static inline host device float4 make_float4(float x, float y, float z, float w){
float4 t; t.x = x; t.y = y; t.z = z; t.w = w; return t;
}