Merge branch 'raysan5:master' into master
This commit is contained in:
commit
7932a158f2
5 changed files with 30 additions and 23 deletions
|
@ -35,10 +35,10 @@ Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
|||
|
||||
features
|
||||
--------
|
||||
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
||||
- **NO external dependencies**, all required libraries are [included into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
||||
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
||||
- Written in plain C code (C99) using PascalCase/camelCase notation
|
||||
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**)
|
||||
- Hardware accelerated with OpenGL: **1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**
|
||||
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||
- Multiple **Fonts** formats supported (TTF, OTF, FNT, BDF, sprite fonts)
|
||||
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
||||
|
|
8
src/external/stb_truetype.h
vendored
8
src/external/stb_truetype.h
vendored
|
@ -1863,11 +1863,11 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
|||
stbtt_vertex* v = &comp_verts[i];
|
||||
stbtt_vertex_type x,y;
|
||||
x=v->x; y=v->y;
|
||||
v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
|
||||
v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
|
||||
v->x = (stbtt_vertex_type)(mtx[0]*x + mtx[2]*y + mtx[4]*m);
|
||||
v->y = (stbtt_vertex_type)(mtx[1]*x + mtx[3]*y + mtx[5]*n);
|
||||
x=v->cx; y=v->cy;
|
||||
v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
|
||||
v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
|
||||
v->cx = (stbtt_vertex_type)(mtx[0]*x + mtx[2]*y + mtx[4]*m);
|
||||
v->cy = (stbtt_vertex_type)(mtx[1]*x + mtx[3]*y + mtx[5]*n);
|
||||
}
|
||||
// Append vertices.
|
||||
tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata);
|
||||
|
|
|
@ -1521,6 +1521,12 @@ int InitPlatform(void)
|
|||
SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
|
||||
|
||||
platform.handle = glfwCreateWindow(CORE.Window.display.width, CORE.Window.display.height, (CORE.Window.title != 0)? CORE.Window.title : " ", monitor, NULL);
|
||||
if (!platform.handle)
|
||||
{
|
||||
glfwTerminate();
|
||||
TRACELOG(LOG_WARNING, "GLFW: Failed to initialize Window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// NOTE: Full-screen change, not working properly...
|
||||
//glfwSetWindowMonitor(platform.handle, glfwGetPrimaryMonitor(), 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
|
@ -1535,6 +1541,12 @@ int InitPlatform(void)
|
|||
int creationHeight = CORE.Window.screen.height != 0 ? CORE.Window.screen.height : 1;
|
||||
|
||||
platform.handle = glfwCreateWindow(creationWidth, creationHeight, (CORE.Window.title != 0)? CORE.Window.title : " ", NULL, NULL);
|
||||
if (!platform.handle)
|
||||
{
|
||||
glfwTerminate();
|
||||
TRACELOG(LOG_WARNING, "GLFW: Failed to initialize Window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// After the window was created, determine the monitor that the window manager assigned.
|
||||
// Derive display sizes, and, if possible, window size in case it was zero at beginning.
|
||||
|
@ -1558,19 +1570,9 @@ int InitPlatform(void)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (platform.handle)
|
||||
{
|
||||
CORE.Window.render.width = CORE.Window.screen.width;
|
||||
CORE.Window.render.height = CORE.Window.screen.height;
|
||||
}
|
||||
}
|
||||
|
||||
if (!platform.handle)
|
||||
{
|
||||
glfwTerminate();
|
||||
TRACELOG(LOG_WARNING, "GLFW: Failed to initialize Window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(platform.handle);
|
||||
result = glfwGetError(NULL);
|
||||
|
|
|
@ -681,7 +681,13 @@ void InitWindow(int width, int height, const char *title)
|
|||
|
||||
// Initialize platform
|
||||
//--------------------------------------------------------------
|
||||
InitPlatform();
|
||||
int result = InitPlatform();
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "SYSTEM: Failed to initialize Platform");
|
||||
return;
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// Initialize rlgl default data (buffers and shaders)
|
||||
|
|
|
@ -5289,19 +5289,18 @@ static Model LoadGLTF(const char *fileName)
|
|||
if (result != cgltf_result_success) TRACELOG(LOG_INFO, "MODEL: [%s] Failed to load mesh/material buffers", fileName);
|
||||
|
||||
int primitivesCount = 0;
|
||||
|
||||
// NOTE: We will load every primitive in the glTF as a separate raylib Mesh.
|
||||
// Determine total number of meshes needed from the node hierarchy.
|
||||
for (unsigned int i = 0; i < data->nodes_count; i++)
|
||||
{
|
||||
cgltf_node *node = &(data->nodes[i]);
|
||||
cgltf_mesh *mesh = node->mesh;
|
||||
if (!mesh)
|
||||
continue;
|
||||
if (!mesh) continue;
|
||||
|
||||
for (unsigned int p = 0; p < mesh->primitives_count; p++)
|
||||
{
|
||||
if (mesh->primitives[p].type == cgltf_primitive_type_triangles)
|
||||
primitivesCount++;
|
||||
if (mesh->primitives[p].type == cgltf_primitive_type_triangles) primitivesCount++;
|
||||
}
|
||||
}
|
||||
TRACELOG(LOG_DEBUG, " > Primitives (triangles only) count based on hierarchy : %i", primitivesCount);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue