mh, yeah after some redaing about Bitmaps i got the point.
I simply didnt konw where to start. Its nowhere stated that the framebuffer is organized like a bitmap.
I havent had any experiences with framebuffers though ive already written little OpenGL aps.
You shouldnt forget im just 15 and still learning *g*
Im not that much skilled in c++ but i've already written some little games and stuff for parsing texts (wouldnt have to be in c++ nescesarely but i just wanted to try).
After i spend some days relaxing and doing sth. else, i tried to find out myself how it works. But whats not documented:
A Bitmap according to Microsofts Specs is starting with the first pixel on the bottom left.
The AVS framebuffer starts with the top left Pixel. Also AVS can only use resolutions that are quadruples of 4 because it cant fill up 4 bytes with zeros so the ampount of bytes per line are divisible by four.
Or has this a different reason? (i.e 32Bit what used by default will always give you a quadruple of 4, so why couldnt you use different resolutions?)
some questions to the c++ code: and YES ive tried to find out myself and this is what i came up with, i just want to know if its correct. I know some questions are realy basic and i think i understood pointers & references. This is no hep forum for c++, but i think its quiet easy for you to answer as my questions arent that difficult.
Ill give some code to explain.
//f recieves the pointer int pointer framebuffer which
//stores the Adress of the first (top/left) pixel
void f (*int framebuffer)
{
std.cout<<framebuffer<<endl; //this would print the adress
std.cout<<*framebuffer<<endl; //this would print the data stored @ the adress
framebuffer= framebuffer + w //this changes the adress by one "line"
This would require the framebuffer to be stored in one sequence in memory, otherwise the result of this operation would be undefined and dangerous.
Next question. if the width of my avs window is 322, is w given to the render function 332, or something else? Because if you want to advance to the next pixel, you would have to go 32Bits ahead.
On a 32Bit system every Adress in the memory stores 32Bit of Data, so simply going on to the next adress means that there is the next pixel in the framebuffer, right?
*framebuffer=color; //this changes the color of the current pixel
right?
for(int j=0;j<halfh;j++) {
for(int i=0;i<halfw;i++) {
framebuffer[i]=color; } framebuffer+=w; }
The framebuffer[i]=color operation has nothing to do woth an array, right? Because the framebuffer is no array, its a sequence of 32bit Pixels stored in sequence in mem.
so whats the []operator???
The STL knows the bitset:😳perator[] but i dont think its waht this operator does.
Could one of you be so kind and correct me?
Sorry for my bad english and my inconvenience