There's no such thing as a 2 bit color depth to my knowledge, so that should either be
Or perhaps you meant
Your function cannot see a variable called temp because there isn't a variable within that function with that name and there are no global variables with that name. If you want your variable Temp in the main program to be accessible to functions, it needs to be global.
And now it's fine.
Graphics3d 1024,768,32
Or perhaps you meant
Graphics3d 1024,768,0,2
Your function cannot see a variable called temp because there isn't a variable within that function with that name and there are no global variables with that name. If you want your variable Temp in the main program to be accessible to functions, it needs to be global.
Global temp = CreateCube()
And now it's fine.