enable multi sampling in Windows, fix circle shape

This commit is contained in:
2017-01-18 00:14:50 +00:00
parent 9e123a6a65
commit b351b70ddf
5 changed files with 87 additions and 46 deletions

View File

@@ -125,7 +125,7 @@ void Circle::create_impl(float radius, int div, GLushort* idx, vertex_t* vertice
void Circle::create_impl(float radius_out, float radius_in, int div, GLushort* idx, vertex_t* vertices, kUVMapping map)
{
count[0] = div * 6;
count[0] = div * (radius_in == 0.f ? 3 : 6);
count[1] = div * 4;
ioff[0] = (GLvoid*)0;
ioff[1] = (GLvoid*)(count[0] * sizeof(GLushort));
@@ -143,8 +143,8 @@ void Circle::create_impl(float radius_out, float radius_in, int div, GLushort* i
}
else
{
vertices[i*2].uvs = { (float)i / div, 0.f };
vertices[i*2+1].uvs = { (float)i / div, 1.f};
vertices[i*2].uvs = { (float)i / div, 0.f }; // inner
vertices[i*2+1].uvs = { (float)i / div, 1.f};// outer
}
vertices[i*2].pos = glm::vec4(uv * radius_in, 0, 1);
vertices[i*2+1].pos = glm::vec4(uv * radius_out, 0, 1);
@@ -155,16 +155,16 @@ void Circle::create_impl(float radius_out, float radius_in, int div, GLushort* i
if (radius_in != 0.f)
{
*pidx++ = i * 2; // A
*pidx++ = ((i + 1) * 2 + 1) % (div * 2); // C
*pidx++ = ((i + 1) * 2) % (div * 2); // D
*pidx++ = i * 2; // A
*pidx++ = ((i+1)*2+1) % (div*2); // C
*pidx++ = ((i+1)*2) % (div*2); // D
}
*pidx2++ = i*2; // A
*pidx2++ = ((i+1)*2) % (div*2); // D
*pidx2++ = i*2+1; // B
*pidx2++ = ((i+1)*2+1) % (div*2);// C
*pidx2++ = i*2; // A
*pidx2++ = ((i+1)*2) % (div*2); // D
*pidx2++ = i*2+1; // B
*pidx2++ = ((i+1)*2+1) % (div*2); // C
}
}