|
@ -87,7 +87,7 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
glewInit(); |
|
|
glewInit(); |
|
|
|
|
|
|
|
|
/*´´½¨program*/ |
|
|
/*´´½¨program*/ |
|
|
GLuint program = CreateGPUProgram("res/shader/UI.vs", "res/shader/UI.fs"); |
|
|
|
|
|
|
|
|
GLuint program = CreateGPUProgram("res/shader/UI FullScreemQuad.vs", "res/shader/UI.fs"); |
|
|
|
|
|
|
|
|
GLuint posLocation, texcoordLocation, normalLocation, MLocation, VLocation, PLocation, NMLocation, textureLocation; |
|
|
GLuint posLocation, texcoordLocation, normalLocation, MLocation, VLocation, PLocation, NMLocation, textureLocation; |
|
|
posLocation = glGetAttribLocation(program, "pos"); |
|
|
posLocation = glGetAttribLocation(program, "pos"); |
|
@ -109,27 +109,6 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine |
|
|
printf("load obj model fail\n"); |
|
|
printf("load obj model fail\n"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
float z = 4.0f; |
|
|
|
|
|
float halfFOV = 22.5f; |
|
|
|
|
|
float randianHalfFOV = 3.14 * halfFOV / 180.0f;//½Ç¶Èת»¡¶È
|
|
|
|
|
|
float tanHalfFOV = sinf(randianHalfFOV) / cosf(randianHalfFOV); |
|
|
|
|
|
float y = tanHalfFOV * z; |
|
|
|
|
|
float aspect = (float)windowWidth / (float)windowHeight; |
|
|
|
|
|
float x = y * aspect; |
|
|
|
|
|
|
|
|
|
|
|
vertexes[0].position[0] = -x; |
|
|
|
|
|
vertexes[0].position[1] = -y; |
|
|
|
|
|
|
|
|
|
|
|
vertexes[1].position[0] = x; |
|
|
|
|
|
vertexes[1].position[1] = -y; |
|
|
|
|
|
|
|
|
|
|
|
vertexes[2].position[0] = -x; |
|
|
|
|
|
vertexes[2].position[1] = y; |
|
|
|
|
|
|
|
|
|
|
|
vertexes[3].position[0] = x; |
|
|
|
|
|
vertexes[3].position[1] = y; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*´´½¨vbo*/ |
|
|
/*´´½¨vbo*/ |
|
|
GLuint vbo = CreateBufferObject(GL_ARRAY_BUFFER, sizeof(VertexData) * vertexCount, GL_STATIC_DRAW, vertexes); |
|
|
GLuint vbo = CreateBufferObject(GL_ARRAY_BUFFER, sizeof(VertexData) * vertexCount, GL_STATIC_DRAW, vertexes); |
|
|
|
|
|
|
|
|