Example #1
0
void SetupUnit::SetupVertex()
{
	switch (m_PrimType)
	{
	case GX_DRAW_QUADS:
		SetupQuad();
		break;
	case GX_DRAW_QUADS_2:
		WARN_LOG(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
		SetupQuad();
		break;
	case GX_DRAW_TRIANGLES:
		SetupTriangle();
		break;
	case GX_DRAW_TRIANGLE_STRIP:
		SetupTriStrip();
		break;
	case GX_DRAW_TRIANGLE_FAN:
		SetupTriFan();
		break;
	case GX_DRAW_LINES:
		SetupLine();
		break;
	case GX_DRAW_LINE_STRIP:
		SetupLineStrip();
		break;
	case GX_DRAW_POINTS:
		SetupPoint();
		break;
	}
}
Example #2
0
s32 CALLBACK
WinMain(HINSTANCE instance,
        HINSTANCE, LPSTR, s32)
{
    WNDCLASS WindowClass = {};
    WindowClass.style = CS_HREDRAW|CS_VREDRAW;
    WindowClass.lpfnWndProc = MainWindowCallback;
    WindowClass.hInstance = instance;
    WindowClass.lpszClassName = "Win32WindowClass";
    WindowClass.hCursor = LoadCursor(0, IDC_ARROW);
    WindowClass.hIcon = LoadIcon(0, IDI_APPLICATION);

    if(RegisterClassA(&WindowClass))
    {
        HWND Window =
            CreateWindowExA(
                0,
                WindowClass.lpszClassName,
                "Steven's Awesome App",
                WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                0,0,instance,0);
        if(Window)
        {
            HDC DeviceContext = GetDC(Window);

            HGLRC GLRenderContext = InitializeOpenGL(Window, DeviceContext);

            GlobalRunning = true;

            LoadGLFunctions();
            SetupTriangle();
            glClearColor(0.0f,1.0f,0.0f,1.0f);

            while(GlobalRunning)
            {
                ProcessPendingMessages();
                Render(GLRenderContext);
                SwapBuffers(DeviceContext);
            }

            wglMakeCurrent(DeviceContext, 0);
            wglDeleteContext(GLRenderContext);

            ReleaseDC(Window, DeviceContext);
        }
    }

    return 0;
}