Alright... short story is that stuff like this always happens when I try and do graphics. One thinks I would learn, but apparently I'm a masochist. So...
Nothing really fancy, small project that sets up a window to draw to.
What I am trying to achieve, for personal reasons, is to write my own rasterizer.
So first things first here are some links to the issue that I am encountering:
https://www.dropbox.com/s/fmuk9rycvnnyqqg/HATE.png
https://www.dropbox.com/s/dyqibeo31qc448y/HATE%202.png
https://www.dropbox.com/s/979twrhf1g8dkcx/HATE%203.png
And here is the code:
Creating the view:
wglMakeCurrent(hdc, hglrc);
glClearColor(0.5f, 0.1f, 0.15f, 1.0f);
glClearDepth(1.0f);
glShadeModel(GL_FLAT);
int width = 0;
int height = 0;
_renderTarget->GetSize(&width, &height);
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-width/2, width/2, -height/2, height/2, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Render the fixed function test background
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(_spin, 0.0f, 0.0, 1.0f);
glColor3f(0.3f, 0.1f, 0.15f);
glRectf(-150.0f, -150.0f, 150.0f, 150.0f);
glPopMatrix();
_rasterizer->Render();
HDC hdc = GetDC(_renderTarget->GetHandle());
SwapBuffers(hdc);
ReleaseDC(_renderTarget->GetHandle(), hdc);
Render my rasterizer
glBegin(GL_POINTS);
glPushMatrix();
int const RenderBufferSize = m_bufferWidth * m_bufferHeight;
for (int i = 0; i < RenderBufferSize; ++i)
{
int x = i % m_bufferWidth;
int y = i / m_bufferWidth;
int halfWidth = m_bufferWidth / 2;
int halfHeight = m_bufferHeight / 2;
glColor4ubv(m_renderBuffer);
glVertex2i(x - halfWidth, halfHeight - y);
}
glPopMatrix();
glEnd();
Hopefully that is enough info, if not just ask.
Any help is greatly appreciated.