Thursday, October 23, 2008
Questions for Week 2
Lecture Questions
Question 2 -My artist are told they have a maximum of 32MB to use for textures. How many textures can they use if they are limit to 256 x 256, with a 24bits palette of 8bits color depth?
-32mb = 32 x 1024 = 32768kb
32768kb = 32768 x 1024 = 33554432 bytes
33554432/(256 x 256) = 512
512/(24/8) = 170.67
Practical Questions
Question 1 – Define a Callback function?
-A callback function
is a function that is called through a function pointer. When you pass the pointer through an argument, the pointer is used to call it's function, therefore a callback is done.
It's used in the functions, often to main, to call other functions due to certain situations.
Question 2 - When exactly is myDisplay()called? How do you get to your findings?
-myDisplay() is a callback function, the main() function uses GlutDisplay to call it to display the pixels or models.
Question 3 – List the process to access the VRAM.
-Firstly, get a memory space of the same size as the VRAM and the double buffer, edit it, copy it to the double buffer then finally swap the buffers to display it on screen
Question 4 - What color format are we using here i.e. 8 bits, 16 bits, 24 bits or 32 bits?
-24 bits, 8 bits are used for red, 8 used for blue and the other 8 used for green.
Question 5 - How much memory have we allocated?
-(800 x 600) x (24/8) = 1,440,000 bytes
= 1.37mb
Question 7 – Describe what has glDrawPixel() done.
-glDrawPixel() will create a pixel at the coordinates stated, it's represented in the RGB format then is written into the buffer.
I am the Beginning and the End