Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*.exe
*.out
*.app
*.pyc

# Cruft
.DS_Store
Expand All @@ -40,6 +41,8 @@ cmake-build*
out/*

# Ides/Agents
__pycache__/
.gitnexus/
.vscode/
.idea/
.vs/
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ python_uninstall:
[working-directory: 'python']
python_test *TEST_OPTS:
python -m pytest -s {{TEST_OPTS}}

rive_update REF="runtime-v0.1.62":
uv run python tools/rive_update.py --rive-ref {{REF}} --allow-dirty --keep-work-dir
1 change: 1 addition & 0 deletions modules/yup_graphics/imaging/yup_Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ bool Image::createTextureIfNotPresent (GraphicsContext& context) const
width,
height,
rive::math::msb (width | height),
rive::GPUTextureFormat::rgba32,
getRawData().data());

return true;
Expand Down
8 changes: 4 additions & 4 deletions modules/yup_graphics/native/yup_GraphicsContext_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ static void GLAPIENTRY err_msg_callback (GLenum source,
const GLchar* message,
const void* userParam)
{
if (type == GL_DEBUG_TYPE_ERROR)
if (type == GL_DEBUG_TYPE_ERROR_KHR)
{
printf ("GL ERROR: %s\n", message);
fflush (stdout);

assert (false);
}
else if (type == GL_DEBUG_TYPE_PERFORMANCE)
else if (type == GL_DEBUG_TYPE_PERFORMANCE_KHR)
{
if (strcmp (message,
"API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state "
Expand Down Expand Up @@ -73,7 +73,7 @@ class LowLevelRenderContextGL : public GraphicsContext
{
#if RIVE_DESKTOP_GL
// Load the OpenGL API using glad.
if (! gladLoadCustomLoader ((GLADloadproc) options.loaderFunction))
if (! gladLoadCustomLoader ((GLADloadfunc) options.loaderFunction))
{
fprintf (stderr, "Failed to initialize glad.\n");
exit (-1);
Expand Down Expand Up @@ -105,7 +105,7 @@ class LowLevelRenderContextGL : public GraphicsContext
#if RIVE_DESKTOP_GL && DEBUG
if (GLAD_GL_KHR_debug)
{
glEnable (GL_DEBUG_OUTPUT);
glEnable (GL_DEBUG_OUTPUT_KHR);
glDebugMessageControlKHR (GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE);
glDebugMessageCallbackKHR (&err_msg_callback, nullptr);
}
Expand Down
4 changes: 3 additions & 1 deletion modules/yup_graphics/native/yup_GraphicsContext_headless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class NoOpRenderPath : public rive::RenderPath

void addPath (rive::CommandPath*, const rive::Mat2D&) override {}

void addRenderPath (rive::RenderPath*, const rive::Mat2D&) override {}
void addRenderPath (const rive::RenderPath*, const rive::Mat2D&) override {}

void moveTo (float, float) override {}

Expand Down Expand Up @@ -179,6 +179,8 @@ class NoOpRenderer : public rive::Renderer
uint32_t indexCount,
rive::BlendMode,
float) override {}

void modulateOpacity (float) override {}
};

//==============================================================================
Expand Down
6 changes: 5 additions & 1 deletion modules/yup_graphics/native/yup_GraphicsContext_metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class LowLevelRenderContextMetal : public GraphicsContext
rive::gpu::RenderContextMetalImpl::ContextOptions metalOptions;

if (m_fiddleOptions.synchronousShaderCompilations)
metalOptions.synchronousShaderCompilations = true;
metalOptions.shaderCompilationMode = rive::gpu::ShaderCompilationMode::alwaysSynchronous;

if (m_fiddleOptions.disableRasterOrdering)
metalOptions.disableFramebufferReads = true;
Expand Down Expand Up @@ -192,8 +192,12 @@ class LowLevelRenderContextMetal : public GraphicsContext
if (m_currentTexture != nil)
{
[m_currentTexture setPurgeableState:MTLPurgeableStateEmpty];
#if defined(__has_feature) && __has_feature(objc_arc)
m_currentTexture = nil;
#else
[m_currentTexture release];
m_currentTexture = nil;
#endif
}

MTLTextureDescriptor* descriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:(MTLPixelFormatBGRA8Unorm)
Expand Down
10 changes: 5 additions & 5 deletions modules/yup_graphics/native/yup_GraphicsContext_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ static void GLAPIENTRY err_msg_callback (GLenum source,
const GLchar* message,
const void* userParam)
{
if (type == GL_DEBUG_TYPE_ERROR)
if (type == GL_DEBUG_TYPE_ERROR_KHR)
{
printf ("GL ERROR: %s\n", message);
fflush (stdout);

assert (false);
}
else if (type == GL_DEBUG_TYPE_PERFORMANCE)
else if (type == GL_DEBUG_TYPE_PERFORMANCE_KHR)
{
if (strcmp (message,
"API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state "
Expand Down Expand Up @@ -84,7 +84,7 @@ class LowLevelRenderContextGL : public GraphicsContext
{
#if RIVE_DESKTOP_GL
// Load the OpenGL API using glad.
if (! gladLoadCustomLoader ((GLADloadproc) options.loaderFunction))
if (! gladLoadCustomLoader ((GLADloadfunc) options.loaderFunction))
{
fprintf (stderr, "Failed to initialize glad.\n");
return;
Expand All @@ -108,7 +108,7 @@ class LowLevelRenderContextGL : public GraphicsContext
#if DEBUG
if (GLAD_GL_KHR_debug)
{
glEnable (GL_DEBUG_OUTPUT);
glEnable (GL_DEBUG_OUTPUT_KHR);
glDebugMessageControlKHR (GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE);
glDebugMessageCallbackKHR (&err_msg_callback, nullptr);
}
Expand Down Expand Up @@ -278,4 +278,4 @@ std::unique_ptr<GraphicsContext> yup_constructOpenGLGraphicsContext (GraphicsCon
}

} // namespace yup
#endif
#endif
4 changes: 2 additions & 2 deletions modules/yup_gui/artboard/yup_ArtboardFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LambdaAssetLoader : public rive::FileAssetLoader

//==============================================================================

ArtboardFile::ArtboardFile (std::unique_ptr<rive::File> rivFile)
ArtboardFile::ArtboardFile (rive::rcp<rive::File> rivFile)
: rivFile (std::move (rivFile))
{
}
Expand Down Expand Up @@ -106,7 +106,7 @@ ArtboardFile::LoadResult ArtboardFile::load (InputStream& is, rive::Factory& fac
is.readIntoMemoryBlock (mb);

rive::ImportResult result;
std::unique_ptr<rive::File> rivFile;
rive::rcp<rive::File> rivFile;

if (assetCallback != nullptr)
{
Expand Down
4 changes: 2 additions & 2 deletions modules/yup_gui/artboard/yup_ArtboardFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class YUP_API ArtboardFile

private:
ArtboardFile() = default;
ArtboardFile (std::unique_ptr<rive::File> rivFile);
ArtboardFile (rive::rcp<rive::File> rivFile);

std::unique_ptr<rive::File> rivFile;
rive::rcp<rive::File> rivFile;
};

} // namespace yup
3 changes: 2 additions & 1 deletion thirdparty/glad/glad.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@

#include "glad.h"

#include "source/glad.c"
#include "source/egl.c"
#include "source/gles2.c"
#include "source/glad_custom.c"
8 changes: 5 additions & 3 deletions thirdparty/glad/glad.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

ID: glad
vendor: glad
version: 1.0.0
version: 0.1.62
name: Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator
description: Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specifications for multiple languages..
website: https://glad.dav1d.de/
Expand All @@ -41,6 +41,8 @@

#pragma once

#include "include/glad.h"
#include "include/EGL/eglplatform.h"
#include "include/KHR/khrplatform.h"
#include "include/glad/egl.h"
#include "include/glad/gles2.h"
#include "include/glad_custom.h"
#include "include/khrplatform.h"
175 changes: 175 additions & 0 deletions thirdparty/glad/include/EGL/eglplatform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#ifndef __eglplatform_h_
#define __eglplatform_h_

/*
** Copyright 2007-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
*/

/* Platform-specific types and definitions for egl.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by filing an issue or pull request on the public Khronos EGL Registry, at
* https://www.github.com/KhronosGroup/EGL-Registry/
*/

#include <KHR/khrplatform.h>

/* Macros used in EGL function prototype declarations.
*
* EGL functions should be prototyped as:
*
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
*
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
*/

#ifndef EGLAPI
#define EGLAPI KHRONOS_APICALL
#endif

#ifndef EGLAPIENTRY
#define EGLAPIENTRY KHRONOS_APIENTRY
#endif
#define EGLAPIENTRYP EGLAPIENTRY*

/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
* are aliases of window-system-dependent types, such as X Display * or
* Windows Device Context. They must be defined in platform-specific
* code below. The EGL-prefixed versions of Native*Type are the same
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
*
* Khronos STRONGLY RECOMMENDS that you use the default definitions
* provided below, since these changes affect both binary and source
* portability of applications using EGL running on different EGL
* implementations.
*/

#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)

typedef void *EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType;

#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>

typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;

#elif defined(__QNX__)

typedef khronos_uintptr_t EGLNativeDisplayType;
typedef struct _screen_pixmap* EGLNativePixmapType; /* screen_pixmap_t */
typedef struct _screen_window* EGLNativeWindowType; /* screen_window_t */

#elif defined(__EMSCRIPTEN__)

typedef int EGLNativeDisplayType;
typedef int EGLNativePixmapType;
typedef int EGLNativeWindowType;

#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */

typedef int EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType;

#elif defined(WL_EGL_PLATFORM)

typedef struct wl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType;

#elif defined(__GBM__)

typedef struct gbm_device *EGLNativeDisplayType;
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;

#elif defined(__ANDROID__) || defined(ANDROID)

struct ANativeWindow;
struct egl_native_pixmap_t;

typedef void* EGLNativeDisplayType;
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
typedef struct ANativeWindow* EGLNativeWindowType;

#elif defined(USE_OZONE)

typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;

#elif defined(USE_X11)

/* X11 (tentative) */
#include <X11/Xlib.h>
#include <X11/Xutil.h>

typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;

#elif defined(__unix__)

typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;

#elif defined(__APPLE__)

typedef int EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType;

#elif defined(__HAIKU__)

#include <kernel/image.h>

typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;

#elif defined(__Fuchsia__)

typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;

#else
#error "Platform not recognized"
#endif

/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
typedef EGLNativeDisplayType NativeDisplayType;
typedef EGLNativePixmapType NativePixmapType;
typedef EGLNativeWindowType NativeWindowType;


/* Define EGLint. This must be a signed integral type large enough to contain
* all legal attribute names and values passed into and out of EGL, whether
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
* handle, or other. While in general a 32-bit integer will suffice, if
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
* integer type.
*/
typedef khronos_int32_t EGLint;


/* C++ / C typecast macros for special EGL handle values */
#if defined(__cplusplus)
#define EGL_CAST(type, value) (static_cast<type>(value))
#else
#define EGL_CAST(type, value) ((type) (value))
#endif

#endif /* __eglplatform_h */
Loading
Loading