Clang Vector Extension support
This commit is contained in:
parent
d2db7b71da
commit
51f336d2ec
6 changed files with 148 additions and 44 deletions
|
|
@ -102,9 +102,9 @@ int main()
|
|||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
Vector3 pos = {
|
||||
.x = mesh.vertices[i*3 + 0],
|
||||
.y = mesh.vertices[i*3 + 1],
|
||||
.z = mesh.vertices[i*3 + 2],
|
||||
mesh.vertices[i*3 + 0],
|
||||
mesh.vertices[i*3 + 1],
|
||||
mesh.vertices[i*3 + 2],
|
||||
};
|
||||
Color color = {
|
||||
.r = mesh.colors[i*4 + 0],
|
||||
|
|
|
|||
|
|
@ -155,9 +155,9 @@ int main(void)
|
|||
for (int i = 0; i < MAX_CUBES; i++)
|
||||
{
|
||||
cubePositions[i] = (Vector3){
|
||||
.x = (float)(rand()%10) - 5,
|
||||
.y = (float)(rand()%5),
|
||||
.z = (float)(rand()%10) - 5,
|
||||
(float)(rand()%10) - 5,
|
||||
(float)(rand()%5),
|
||||
(float)(rand()%10) - 5,
|
||||
};
|
||||
|
||||
cubeRotations[i] = (float)(rand()%360);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ int main(void)
|
|||
modelA.transform = MatrixMultiply(modelA.transform, MatrixRotateZ(0.012f));
|
||||
|
||||
// Update the light shader with the camera view position
|
||||
SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], &camera.position.x, SHADER_UNIFORM_VEC3);
|
||||
SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], &camera.position, SHADER_UNIFORM_VEC3);
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ int main(void)
|
|||
marchLocs.screenCenter = GetShaderLocation(shdrRaymarch, "screenCenter");
|
||||
|
||||
// Transfer screenCenter position to shader. Which is used to calculate ray direction.
|
||||
Vector2 screenCenter = {.x = screenWidth/2.0f, .y = screenHeight/2.0f};
|
||||
Vector2 screenCenter = { screenWidth/2.0f, screenHeight/2.0f};
|
||||
SetShaderValue(shdrRaymarch, marchLocs.screenCenter , &screenCenter , SHADER_UNIFORM_VEC2);
|
||||
|
||||
// Use Customized function to create writable depth texture buffer
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ int main(void)
|
|||
spots[i].inner = 28.0f * (i + 1);
|
||||
spots[i].radius = 48.0f * (i + 1);
|
||||
|
||||
SetShaderValue(shdrSpot, spots[i].positionLoc, &spots[i].position.x, SHADER_UNIFORM_VEC2);
|
||||
SetShaderValue(shdrSpot, spots[i].positionLoc, &spots[i].position, SHADER_UNIFORM_VEC2);
|
||||
SetShaderValue(shdrSpot, spots[i].innerLoc, &spots[i].inner, SHADER_UNIFORM_FLOAT);
|
||||
SetShaderValue(shdrSpot, spots[i].radiusLoc, &spots[i].radius, SHADER_UNIFORM_FLOAT);
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ int main(void)
|
|||
if (spots[i].position.y > (screenHeight - 64)) spots[i].speed.y = -spots[i].speed.y;
|
||||
}
|
||||
|
||||
SetShaderValue(shdrSpot, spots[i].positionLoc, &spots[i].position.x, SHADER_UNIFORM_VEC2);
|
||||
SetShaderValue(shdrSpot, spots[i].positionLoc, &spots[i].position, SHADER_UNIFORM_VEC2);
|
||||
}
|
||||
|
||||
// Draw
|
||||
|
|
|
|||
|
|
@ -3722,7 +3722,7 @@ int GuiColorPicker(Rectangle bounds, const char *text, Color *color)
|
|||
// NOTE: this conversion can cause low hue-resolution, if the r, g and b value are very similar, which causes the hue bar to shift around when only the GuiColorPanel is used.
|
||||
Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){ (*color).r/255.0f, (*color).g/255.0f, (*color).b/255.0f });
|
||||
|
||||
GuiColorBarHue(boundsHue, NULL, &hsv.x);
|
||||
GuiColorBarHue(boundsHue, NULL, (float*)&hsv);
|
||||
|
||||
//color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f);
|
||||
Vector3 rgb = ConvertHSVtoRGB(hsv);
|
||||
|
|
@ -3756,7 +3756,7 @@ int GuiColorPickerHSV(Rectangle bounds, const char *text, Vector3 *colorHsv)
|
|||
|
||||
const Rectangle boundsHue = { (float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height };
|
||||
|
||||
GuiColorBarHue(boundsHue, NULL, &colorHsv->x);
|
||||
GuiColorBarHue(boundsHue, NULL, (float*)&colorHsv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -5718,4 +5718,4 @@ static int GetCodepointNext(const char *text, int *codepointSize)
|
|||
}
|
||||
#endif // RAYGUI_STANDALONE
|
||||
|
||||
#endif // RAYGUI_IMPLEMENTATION
|
||||
#endif // RAYGUI_IMPLEMENTATION
|
||||
|
|
|
|||
Loading…
Reference in a new issue