-
|
I've spent my entire day trying to set up RmlUi in my SDL2 + OpenGL project, and I just can't, for the life of me, figure out what is wrong. The first problem was with RmlUi_RendererGL3.cpp trying to do something with glad, which was conflicting with my other code that already sets up glad, so I removed The issue I ran into after this, I think, has something to do with a call to RenderInterface_GL3::RenderInterface_GL3()
{
auto mut_program_data = Rml::MakeUnique<Gfx::ProgramData>();
if (Gfx::CreateShaders(*mut_program_data))
{
program_data = std::move(mut_program_data);
Rml::Mesh mesh;
Rml::MeshUtilities::GenerateQuad(mesh, Rml::Vector2f(-1), Rml::Vector2f(2), {});
fullscreen_quad_geometry = RenderInterface_GL3::CompileGeometry(mesh.vertices, mesh.indices);
}
}Another issue I run into is this: Lastly, here is my code which tries to setup rmlui #define RMLUI_SDL_VERSION_MAJOR 2
#include <RmlUi/Core.h>
#include <RmlUi/Debugger.h>
#include <rmluiimpl/RmlUi_Backend.h>
#include <rmluiimpl/RmlUi_Platform_SDL.h>
#include <rmluiimpl/RmlUi_Renderer_GL3.h>
#include "rmluiimpl/shell/include/Shell.h"
void Game::init()
{
//Shell::Initialize();
//Backend::Initialize("RmlUiWindow", 1280, 720, true);
//static CustomSystemInterface sysInterface;
//static CustomRenderInterface rendInterface;
//Rml::SetSystemInterface(&sysInterface);
//Rml::SetRenderInterface(&rendInterface);
//Rml::SetSystemInterface(Backend::GetSystemInterface());
//Rml::SetRenderInterface(Backend::GetRenderInterface());
//static SystemInterface_SDL sysInterface;
//static RenderInterface_GL3 rendInterface;
Backend::Initialize("RmlUiWindow", 1280, 720, true);
Rml::SetSystemInterface(Backend::GetSystemInterface());
Rml::SetRenderInterface(Backend::GetRenderInterface());
Rml::Initialise();
Rml::Context* context = Rml::CreateContext("main", Rml::Vector2i(1280, 720));
//Rml::LoadFontFace("");
//auto* doc = context->LoadDocument("");
//if (doc) doc->Show();
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Hello there! Alright, there's quite a bit going on here. First of all, for the unresolved symbols, it looks like you're not adding the source code for the backend code? At least not the ones containing the referenced functions. Secondly, you must have gotten this compiled somehow, but I'm not sure how you're running the code causing the memory exception. You're mentioning modifying the glad includes, so it could be that something is conflicting here. Make sure you are initializing glad somewhere, before the GL3 renderer constructor, and that you are not mixing up different GL headers. I don't think Let me know how it goes :) |
Beta Was this translation helpful? Give feedback.
-
|
@mikke89 Sorry to be a nuisance, but I decided to start over, and after following the documentation, I was able to run the space invader sample project. So, I created a new project to test rmlui without using the samples, but once again ran into issues in the |
Beta Was this translation helpful? Give feedback.


Hey, no worries. To be honest, that project structure is quite a mess. It's hard to say what's going wrong exactly, but you've got binaries all over the place, hah. Lib files in some places, but dll files being copied from elsewhere. It would be quite a lot of effort for me just being able to build that project.
It could be that you are mixing up binaries, i.e. you need to make sure all lib-files correspond to the dll files being copied in. And everything should be built with the same compiler flags. In particular, make sure you don't mix up debug/release binaries, and runtime libraries being used. You also need to make sure that RmlUi is built against the same FreeType version that is be…