Change O3DVertex struct
FossilOrigin-Name: 2bf3eabe2875f0326928d79864923dab8a34d4d0a706d21bcf9370cb456fdd0d
This commit is contained in:
parent
cdf559f8e3
commit
95fd0d1a5d
3 changed files with 20 additions and 14 deletions
|
@ -212,12 +212,14 @@ grGlideShutdownCdecl(void)
|
||||||
GrVertex *glideVertices = OFAllocZeroedMemory(count, sizeof(GrVertex));
|
GrVertex *glideVertices = OFAllocZeroedMemory(count, sizeof(GrVertex));
|
||||||
@try {
|
@try {
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
glideVertices[i].x = (vertices[i].x + 1) * halfWidth;
|
glideVertices[i].x =
|
||||||
glideVertices[i].y = (vertices[i].y + 1) * halfHeight;
|
(vertices[i].position.x + 1) * halfWidth;
|
||||||
glideVertices[i].r = vertices[i].r * 255;
|
glideVertices[i].y =
|
||||||
glideVertices[i].g = vertices[i].g * 255;
|
(vertices[i].position.y + 1) * halfHeight;
|
||||||
glideVertices[i].b = vertices[i].b * 255;
|
glideVertices[i].r = vertices[i].color.r * 255;
|
||||||
glideVertices[i].a = vertices[i].a * 255;
|
glideVertices[i].g = vertices[i].color.g * 255;
|
||||||
|
glideVertices[i].b = vertices[i].color.b * 255;
|
||||||
|
glideVertices[i].a = vertices[i].color.a * 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
grDrawPolygonVertexList((int)count, glideVertices);
|
grDrawPolygonVertexList((int)count, glideVertices);
|
||||||
|
|
|
@ -18,8 +18,12 @@
|
||||||
OF_ASSUME_NONNULL_BEGIN
|
OF_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
typedef struct OF_BOXABLE {
|
typedef struct OF_BOXABLE {
|
||||||
float x, y;
|
struct {
|
||||||
float r, g, b, a;
|
float x, y;
|
||||||
|
} position;
|
||||||
|
struct {
|
||||||
|
float r, g, b, a;
|
||||||
|
} color;
|
||||||
} O3DVertex;
|
} O3DVertex;
|
||||||
|
|
||||||
@protocol O3DRenderer <OFObject>
|
@protocol O3DRenderer <OFObject>
|
||||||
|
|
|
@ -32,14 +32,14 @@ OF_APPLICATION_DELEGATE(TestsAppDelegate)
|
||||||
options: nil] autorelease];
|
options: nil] autorelease];
|
||||||
|
|
||||||
const O3DVertex outerTriangle[] = {
|
const O3DVertex outerTriangle[] = {
|
||||||
{ -1, -1, 1, 0, 0 },
|
{{ -1, -1 }, { 1, 0, 0 }},
|
||||||
{ 0, 1, 0, 1, 0 },
|
{{ 0, 1 }, { 0, 1, 0 }},
|
||||||
{ 1, -1, 0, 0, 1 }
|
{{ 1, -1 }, { 0, 0, 1 }}
|
||||||
};
|
};
|
||||||
const O3DVertex innerTriangle[] = {
|
const O3DVertex innerTriangle[] = {
|
||||||
{ -0.5, 0.5, 1, 1, 0 },
|
{{ -0.5, 0.5 }, { 1, 1, 0 }},
|
||||||
{ 0, -0.5, 0, 1, 1 },
|
{{ 0, -0.5 }, { 0, 1, 1 }},
|
||||||
{ 0.5, 0.5, 1, 0, 1 }
|
{{ 0.5, 0.5 }, { 1, 0, 1 }}
|
||||||
};
|
};
|
||||||
|
|
||||||
OFDate *startDate = [OFDate date];
|
OFDate *startDate = [OFDate date];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue