Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
part 1-8
Michael R. P. Ragazzon
@mikke89
Ah, these are very cool, didn't know there were standalone runtimes. That is very interesting, then I do understand how RmlUi could be a good fit for such projects :)
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
ui
part
Michael R. P. Ragazzon
@mikke89
Yup
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
all apps need forms/menu/...
Michael R. P. Ragazzon
@mikke89
I understand now, I thought you always had a full browser to take advantage of.
it can work as electron/nwjs replacement
lite version
lite-xl.github.io can benefit from this
Michael R. P. Ragazzon
@mikke89
Yeah, I'd love to see something more lightweight take over from electron. One has to appreciate the irony though if one ends up integrating RmlUi into a wasm application and running it in the browser.
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
:)
best part, all can be done with static link
libsdl+rmlui as one runtime
Michael R. P. Ragazzon
@mikke89
Ah, that's very nice.
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
probably also with wasm runtime
then all you need is an small wrapper to start
and you have all cross platform
UI + CSS + Logic
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
zygon.sisyphus
@zygon.sisyphus:matrix.org
[m]
Michael R. P. Ragazzon
@mikke89
@Foxxey Hey, and welcome! I don't really understand the setup, it looks like you are trying to integrate the library into your own project, but also including the RmlUi samples. I think you should start with just building the samples themselves using CMake, before trying to integrate it. Did you read the building documentation? Let us know if anything there is unclear.
Jack Powell
@jack9267
Is there a Discord server for RmlUi at all?
LWSS
@LWSS
no, discord sucks
Michael R. P. Ragazzon
@mikke89
Yeah, we only use this space for chats.
Foxxey
@Foxxey
aight I have a basic glfw, glad setup which just opens a window. how do i implement RmlUI into it?
i managed to setup all the libraries, I think
Foxxey
@Foxxey
image.png
Michael R. P. Ragazzon
@mikke89
@Foxxey Good job. Next up, you need to implement the system and render interfaces: https://mikke89.github.io/RmlUiDoc/pages/cpp_manual/integrating.html
Jack Powell
@jack9267
image.png
It didn't take me long to make a system/render/file interface for something I'm making for the GTA series. I made a renderware renderer for RmlUi.
Michael R. P. Ragazzon
@mikke89
@jack9267 Good job! That is very cool, so now we can use RML in GTA! :D
Is the renderer open source, if so I'd be happy to link to it from the resources post.
Jack Powell
@jack9267
It isn't open source although I can probably separate it all (when its tidier) https://gtaconnected.com/ is the mod site, I used to use my own GUI system so been trying to merge both together a bit.
Supports gta3/vice city/san andreas/iv
void CRmlRenderInterface::RenderGeometry(Rml::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rml::TextureHandle texture, const Rml::Vector2f& translation)
{
    static RwIm2DVertex rgVertices[4096];
    static RwImVertexIndex rgIndices[4096];

    if (num_vertices > ARRAY_COUNT(rgVertices) || num_indices > ARRAY_COUNT(rgIndices))
        return;

    float fZ = RwIm2DGetNearScreenZ();
    float fRHW = 1.0f / CGTA::GetCurrentRWCamera()->nearPlane;

    for (size_t i = 0; i < num_vertices; i++)
    {
        CVector3D::TransformCoordinate(CVector3D(vertices[i].position.x + translation.x, vertices[i].position.y + translation.y, fZ), m_matTransform, rgVertices[i].vec);
        rgVertices[i].vec.x -= 0.5f;
        rgVertices[i].vec.y -= 0.5f;
        rgVertices[i].rhw = fRHW;
        rgVertices[i].emissiveColor = CARGB(vertices[i].colour.alpha, vertices[i].colour.red, vertices[i].colour.green, vertices[i].colour.blue);
        rgVertices[i].u = vertices[i].tex_coord.x;
        rgVertices[i].v = vertices[i].tex_coord.y;
    }

    for (size_t i = 0; i < num_indices; i++)
    {
        rgIndices[i] = indices[i];
    }

    RwRenderStateSet(rwRENDERSTATEZTESTENABLE, FALSE);
    RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
    Texture* pTexture = (Texture*)texture;
    RwRaster* pRwRaster = nullptr;
    if (pTexture != nullptr)
        pRwRaster = Rw2D.GetRwRaster(pTexture);
    RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, rwFILTERLINEAR);
    RwRenderStateSet(rwRENDERSTATESRCBLEND, rwBLENDSRCALPHA);
    RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDINVSRCALPHA);
    RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, TRUE);
    RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, rwTEXTUREADDRESSCLAMP);
    RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (unsigned int)pRwRaster);
    RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, rgVertices, num_vertices, rgIndices, num_indices);
}
Looks like this for example.
Michael R. P. Ragazzon
@mikke89
I'm sure many would be interested if you decide to open source it :) Did you encounter any particular challenges during development?
Jack Powell
@jack9267
Scissor region got be stumped for a while until I thought about the viewport trick.
image.png
All renders just fine all the things that need scissor.
Michael R. P. Ragazzon
@mikke89
There's no built-in scissor API?
Jack Powell
@jack9267
Nope as renderware for gta3/vc is d3d8.
d3d9 adds scissor