#πŸ’€ Cortex Engine

1 messages Β· Page 11 of 1

clear dome
#

Honestly, SDL is amazing already, I’m glad it exists

ionic badger
#

yeah

#

and running sdl3 is even cooler

clear dome
#

So far I didn’t have any issue related to building SDL3 separately from Haxe btw, it just works. This dpi issue is more about using the correct SDL api

void condor
#

it's always a shitshow

#

@ionic badger double and tripple checked, running a 4k display @ 1080 and it's all fine

molten sleet
#

I think i have the niche-iest setup here
Wayfire on Arch with integrated Intel Xe Graphics

void condor
#

100%

ionic badger
#

maybe try with the scaling, linux seems to do weird things with scaling

void condor
#

that makes shit go completely haywire

#

but for my whole desktop

#

You use the experimental fractional scaling

ionic badger
#

it seems relatively okay for most use

#

it defo isn't correct or "how i'd like it"

#

but 150 is waaaay too much

void condor
#

cant really replicate here. Guess we'll have to wait till I test more configs πŸ˜„

ionic badger
#

very odd, considering we're both on mint

#

100% scaling is better

void condor
#

no

#

your desktop runs at 4k

#

maybe I misunderstood, but you said you run your screen resolution @ 1440 , 4k being the native resolution of the screen

ionic badger
#

when i first tested it was 1440p@125% scaling (for overwatch). Now i'm "back to" my normal day-day resolution of 4k@125% scaling

#

screenshot above is testing 4k@100% scaling

#

this inspector is so damn cool

#

not sure if intentional, but scrolling with the mouse wheel doesn't bump the fps up

void condor
#

oh that's true

#

good catch

#

no wait

#

it should

ionic badger
#

but if you're over the actual scroll container, it doesn't

void condor
#

the throttling is hooked into the sdl event loop, so any mouse event should mark a frame dirty, no matter where you at in the UI

ionic badger
#

can you repro?

#

I've just abandoned the 125% scaling lol

#

and switched to 100% with text scaling to 1.3, and increased the start menu dimensions. This is way better

void condor
ionic badger
#

I avoided this solution because bad history on wayland, but on x11 it literally does scale all text in all apps completely fine

void condor
#

if you open the console (^) and run throttleMode() it disables throttling. throttleMode("low") to re-enable

void condor
#

next() will cycle between the other samples

ionic badger
#

when trying to scroll over the purple background it will raise the fps back to 120

#

but in the actual containers, it just raises to 60

#

60 is what my monitor is running at, but, the discrepency is a bit odd

void condor
#

it should run with vsync. in the project.cortex you can disable vsync

#

weeeeeird πŸ˜„

ionic badger
#

maybe just my system weirdness/arc driver oddness

void condor
#

I defo need more datapoints

ionic badger
#

i added this kind of throttling in my haxeui backend for ceramic

#

it's a nice little addition πŸ˜„

void condor
#

yeah, it was defo necessary to add it to cool down my cppia life a little

#

I have the app open for long sessions and just hot reload iterations, my laptop drew quite some power just having the idle app open

molten sleet
#

testing now

#

well thats

void condor
#

see what logo wrote

#

wayland is missing something

molten sleet
#

however

#

running with SDL_VIDEODRIVER=X11

#

works perfectly

#

my only complaint is that horizontal scrolling doesnt seem to be inverted but that might be an issue with my setup

void condor
#

ah interesting

molten sleet
void condor
#

most of the controls are wired up and do stuff. if you click the fps graph it switches modes etc. console can be open with ^(tilde) key and using next() command cycles to the other samples/tests

crystal grove
#

@void condor in statecharts, I get a null reference error with this <Transition to="Unhappy" guard="isUnhappy" />, which seems valid. It's fixed by null checking transition.event in a certain spot I guess bc .event is null and not ""

#

Does that sound like a bug and PR, or user error?

#

Here, works if I check hasEvent instead of just length == 0

void condor
void condor
#

hasEvent makes the most sense.

#

pushed a fix

crystal grove
#

Ok thanks, that’s why I asked bc your samples use that

neat smelt
#

It runs well and looks good, but is it supposed to react to window size changes?

#

when I stretch out the window, the UI stays in the corner

void condor
neat smelt
#

No, a small laptop screen πŸ™‚
The window opened to the exact size of the UI and looks good. It's only when I resize the window that the result was maybe unexpected

void condor
#

one more thing you folks could test: opengl, change the renderer to "OpenGL" in project.cortex and see if there is a visual difference to vulkan. For me there is one, but it might have to do with my drivers and the fact, that ogl uses a different gpu on my end

void condor
#

stretches

#

time to work on a real endboss ui feature

void skiff
#

cortex only works on linux?

void condor
void skiff
#

Is there a build for windows? i want to test it

void condor
#

unfortunately I dont have a windows build currently

void skiff
#

:c

void condor
#

eventually there will be a windows build. just no priority atm

void condor
#

Im rewriting the sucker tomorrow πŸ˜„

crystal grove
#

I’m very curious how far down the text rabbit hole you’re going

void condor
#

heh, bgfx already includes stb_textedit.h, so I will simply plug that in. The extern is already done and mouse input works πŸ˜„

void condor
#

god I love this

void condor
#

building a textfield is like playing Counter-Strike, easy to get in, hard to master πŸ”₯

#

and I love the pog moments when universes collide like this: hxcpp, imgui's stb_textedit & nanovg

ionic badger
void condor
#

this textfield uses like the most features of my ui all at once: transitions, animations, overflow scrolling + styled scrollbars & lots of event listeners & handlers

clear dome
#

The main missing feature of Ceramic’s text input is the horizontal scroll like what a standard text input does. I have the various parts available to make it, but didn’t spend the time to implement it yet

ionic badger
#

oh iirc there's a bit of a bug with copy paste with ceramic input πŸ€”

ionic badger
#

something along those lines

clear dome
#

This is not a really a bug, it depends on the ceramic target and context, like, you can’t access just clipboard like that from a browser

ionic badger
#

need to see if it occurs on native

clear dome
#

When Ceramic can’t access outside clipboard, it falls back to app-level emulated clipboard so you can still copy paste things within the app

ionic badger
#

will check now, just tried pasting into ceramic from discord and didn't work

#

been a lil bit since i last tested on native πŸ˜…

ionic badger
#

electron

clear dome
#

Yeah, can’t tell about your custom electron setup.

ionic badger
#

Oh wait, i swear we spoke about this before and I recall locally solving it

clear dome
#

And not sure I actually implemented the clipboard via electron yet

clear dome
#

(Sorry for hijacking your thread xd daz)

ionic badger
#

i'll do my next reply in your cosy livingroom πŸ˜‚

clear dome
#

Yeah, just grab your β˜•

void condor
clear dome
#

I could put that inside a Scroller which would make scrolling via touch or mouse possible, but before I'll need to check how a standard text input scrolling works, maybe it's just about moving the text cursor around. In other words: everything is there to do it, but didn't figure out exactly what I should do yet 😁. Some dayβ„’

#

(I know !billy asked for it though 😬 )

ionic badger
#

I would do it but I never know the correct places to add these things

#

or at least attempt/put it on the Todo list

clear dome
#

Yeah this I’ll probably have to do it myself, too many moving parts involved to get right

void condor
#

Next I want to worry about modals and overlay input focus

clear dome
#

I understand. I do have globally handled transform hierarchy and clipping too (and scrolling with the Scroller visual. It's just that the text provides its own thing in addition to that

#

Also, currently Ceramic currently doesn't support nesting multiple clip rects or shapes (based on scissor or stencil) within a visual object hierarchy, so if I had to use it for a text object, I couldn't use it for a parent container that contains this text object. This could be improved in the renderer of course by computing an intersect of the nested clipping shapes on the fly, but that's not supported at the moment

#

(that's also why I suggested @ionic badger to use Filter objects to nest clipping objects in haxeui: you can nest any level of render textures, and the render target boundaries viewport acts as a clipping rect just fine. If later I do the above improvement, nesting would work also by using stencil without intermediate textures)

neat smelt
#

Text field usually has a New Game + feature

#

"but does it handle Arabic?"

void condor
#

I have been long searching for a solution without going fullblown harfbuzz on this

#

with some tweaks it plugs nicely into my setup

#

biggest problem: I cant read what this will produce, so error-checking and debugging will be super tedious. So decided to kick this can down the road until further notice

#

Like how the fuck you deal with this: https://github.com/JimmyLefevre/kb/issues/34

GitHub

With NotoSansDuployan-Regular.ttf HarfBuzz: $ hb-view NotoSansDuployan-Regular.ttf '𛱇𛰣 𛰂𛱆 𛰆𛱄𛰉𛰅𛰋𛱁𛰄𛰃' $ hb-view NotoSansDuployan-Regular.ttf 'π›±π›°†π›±‡π›°…π›°œ π›°…π›±„π›°ˆ π›±Šπ›±β€Œπ›°…π›± π›°™π›±β€Œπ›°™π›±›π›°… π›±›β€Œπ›°…π›±›π›°… π›°œπ›±‡π›±‡β€Œπ›°œπ›±‡π›°™ π›°…π›±„β€Œπ›°‚π›± 𛰣𛱇...

#

alien shit

neat smelt
#

advertise your app to have perfect [language] support

#

then you will get many detailed bug reports

ionic badger
#

I'm enjoying my gitea server

#

always running, haven't had to do anything with it to maintain it since i set it up

void condor
#

yeah, super simple to run

#

mine is currently offline due to vacations. 🀣

ionic badger
#

i also setup the cloudflare zero trust thing, i've got it remotely accessible

#

it's a really cool setup overall

void condor
#

nice! in my case I tend to shutdown my personal stuff while im gone. No need to run stuff while im out, high up in the austrian alps πŸ˜„

ionic badger
#

the minipc i got it running on takes like 12watts to run

#

was very mindful of running power πŸ˜„

#

how long are you on vacation for?

green breach
void condor
#

we went the last whole week. just came back today

green breach
#

or else you will be put in a genkit scenario

void condor
#

had an amazing time: From a swim in the summer sun, chilling hikes to mountainlakes and finally an insane thunderstorm painting the mountaintops white with snow

#

can defo recommend the High Tauern for anyone that likes mountains and a shitton of nature

ionic badger
#

what happened to genkit

green breach
hollow spindle
#

Technically no he has it stored at his dad's house somewhere

#

Yes he said that when I went to talk to him on dm's

ionic badger
#

ohhh i remember him saying that

#

I think i'll be fine considering i switched out the shipped (no name) m.2

#

but I do plan on actually adding another drive in there at some point for backups

#

a simple script that runs at the end of the day would suffice (or something like that)

green breach
#

you should technically still have a off site backup, def a good idea

ionic badger
#

it's not much of a priority for short term

void condor
ionic badger
#

so much headroom for a pretty cheap device

green breach
ionic badger
green breach
#

ah ok, ubuntu is so much better on servers

ionic badger
#

its been completely fine

#

no issues

#

and can always access it whenever i need to via ssh

green breach
#

you can tell canonical puts more effort into ubuntu server than the desktop variant

ionic badger
#

its likely their primary income stream

green breach
#

for sure

#

although they make money from snaps and those aren't particularly good

void condor
#

finally! cortex supports package-based resources/assets in the monorepo now. no more shitty duplication between apps now

void condor
#

this was the hike up the canyon into the alpine

#

the place we stayed at

void condor
green breach
void condor
# green breach samhocevar is on this server and is sometimes active in the kore server

nice. I just completed the externs, works like a charm

 
var res = FileDialogs.open_file("OPEN FILES", "", ["Cortex Resource Files", "*.cxr"], Option.Multiselect);
trace(res);

var res = FileDialogs.save_file("Save a file", ".cxr", ["Cortex Resource Files", "*.cxr"]);
trace(res);

var res = FileDialogs.select_folder("Select a folder");
trace(res);

var btn:Button = FileDialogs.message(
    "Unsaved Files",
    "Do you want to save the current document\n before closing the application?",
    Choice.Yes_No_Cancel, Icon.Warning);

FileDialogs.notify(
    "Cortex event", 
    "Something might be on fire πŸ”₯", 
    Icon.Warning
);
neat smelt
molten sleet
#

doesnt SDL3 have dialogs

neat smelt
#

Would you consider publishing the externs, @void condor

neat smelt
molten sleet
neat smelt
#

Okay but one is not me, and adding a rule file picker is a smaller task

neat smelt
molten sleet
#

well
I am

For beacon I'm planning to extern a good few libraries

#

SDL3, SDL3_Image, LLGL, miniaudio, and a few other libs

void condor
neat smelt
void condor
#

should be super easy

neat smelt
ionic badger
#

looks like a really nice place

void condor
#

looking at the traffic stats of my github repos im convinced 90% of clones and visitors is AI

clear dome
void condor
#

plus you get message boxes and OS notifications

clear dome
#

I see, nice! I should take a look if you share the externs

neat smelt
#

Thank you!

clear dome
#

Oh, actually, I might have a very short term use of that, but that’s for an internal tool

void condor
#

cool. lemme know if there are any issues, PRs welcome

#

I need to review my dependency management of resources, the new package system kinda screws with the old logic :/

void condor
#

ok, even found&fixed a bug.

#

NOW I need to take the dog outside, get some food and then I can finally finish scrollIntoView & the missing bits of my TextInput

void condor
#

ok, there was an issue with linc_filedialogs and the default parameters of the methods

clear dome
#

I won’t use it right away anyway, I have too many things on my plate right now πŸ˜„

void condor
#

nullability can be tricky to get right with native types for all 3 targets. But it's working now

void skiff
#

nah bro πŸ’€ you are the goat

clear dome
void skiff
#

fr

void condor
void condor
#

oh, looks like I blew past 60k lines of code

#

just cortex without the dependencies is ~22k, 10k of that is the ui package

void skiff
#

whattheheeell

void condor
#

man, there are moments when I love this ui system soo much

void condor
#

the last 3 days πŸ˜„

#

NO AI!

#

xD

grizzled laurel
#

pffff

#

jeeeeezus

void skiff
#

WTH

void condor
#

we are on a stroll

void condor
#

waaahhh

#

adding a general purposescrollIntoView was easier than I thought... 60 lines of code πŸ˜„

#

this is what happens when you have shit in place

hollow spindle
#

I've been wondering about why the c++20 pr isn't ready for pr on the hxcpp repository yet

void condor
hollow spindle
#

Github actions already tests all the targets for you

void condor
#

I doubt they test all the compiler defines

#

all the actions say is that my shit didnt break the standard compile

void condor
#

10 unique visitors and 20 unique cloners

#

anyone bold enough to interpret these numbers?

hollow spindle
#

Linux and Mac? Besides windows?

ionic badger
hollow spindle
#

I tested this on windows

#

It worked like - perfectly

#

So hold on, did dazkind already test it on Linux!?

void condor
#

windows and linux should work

#

cortex uses cpp20 on windows & linux

#

at the time I added the PR I only had windows

#

guess i just push it out of draft and we see what happens

void condor
#

70's supergraphic go soo hard

green breach
void condor
void condor
#

FINALLY!

grizzled laurel
#

:O

void condor
#

one little issue with the scroll bar exploding in certain frames around string start, but that should be easy now

#

this rocks. instead of having custom logic to follow the cursor around it reuses the overflow scroll functionality from the control core to keep the cursor in view. it just has custom styled scrollbars. πŸ˜„

grizzled laurel
#

it's so cool that any of this works really. It's like mannyyy different subsystems and you get a pretty "native" feeling UI

void condor
#

not sure if I should feel offended. WHAT DO YOU MEAN BY "THAT ANY OF THIS WORKS REALLY"?!?! IN THIS HOUSE WE BUILD TO WIN!

#

j/k πŸ˜„

#

I promised myself this will be the last UI system I write & fumble together

#

concerning "native" feel, once one gets serious with the css, shit will blow people away

grizzled laurel
#

like we can interact with graphics (in your case through BGFX)

#

we have some input

#

use a library here and there for flexbox layout

#

you write many components

#

and boom, super cool UI

#

this is simplified ofc, but like, this is genuinely so cool

#

XD

#

like this UI system you built reminds me of why programming is so super enjoyable

#

i can tell alot of effort and passion has gone into it πŸ˜„

#

great stuff man, really well done :D

void condor
#

oh I get it. it's all a big integration exercise

#

thanks! this beast will unblock some insane stuff I have prepared

grizzled laurel
#

can't wait :)

void condor
#

I complete 1-2 more milestones I can finally go back to 3D and unlock the most advanced modern haxe renderer ever

grizzled laurel
#

what are you planning in terms of features?

void condor
#

wait and see. I integrated compute shaders the other day... πŸ˜„

grizzled laurel
#

uhoh

#

that does unlock alot of oppertunities

#

particles, GI and that is just scratching the surface

void condor
#

but my biggest pain is asset creation/management atm. I need ui tooling for that otherwise it's always such a drag adding & maintaining new content. That's why I need to get the UI out of the way to offer enough functionality for the tools I need

grizzled laurel
#

i wonder how that will end up

#

i can imagine like cool tooling for statecharts and stuff

#

because i know you love those

#

very interested to follow the progress

#

will defo read upcoming previews :)

void condor
#

yeah, I have been looking at compute particles recently and Im burning to get working on those. Also maybe deferred/forward clustered renderpipelines. There are soo many cool bgfx setups I can build upon and port them to cortex flexible renderer

grizzled laurel
#

yeah defo

#

ive been looking into compute too

#

to me the underlying concepts on how to intergrate compute with your renderer is pretty straight forward, but making it look good

#

i just have no clue

void condor
#

when it comes to compute, I literally have no idea what Im doing.

grizzled laurel
#

i really need to up my ability to interpret those books you sent me

#

i just cant with all the equations lol

void condor
#

I cant even read those. Dont tell anyone

#

I need to read (pseudo)code to grasp what is going on

grizzled laurel
#

yeahhh same....

#

i want to adjust it but can't

#

well I can in some cases, but if I want to change how something actually "behaves"

#

it just becomes a reallyyy bad time

#

this is one of the reasons I actually want to get a masters degree

#

my hope is that I can gain the knowledge to read academic papers there... (which hopefully helps in gaining understanding on how stuff actually behaves, like why does some random equation give me pretty pixels..?)

void condor
#

it takes a bit of practice. But sure it cant hurt

grizzled laurel
#

yeah defo

void condor
#

In the old days I spent 4 months dissecting a single paper. word for word to implement a software rasterer for occlusion culling

grizzled laurel
#

also dude, i wanna thank you again for helping me get into graphics programming all that time ago

ionic badger
ionic badger
void condor
void condor
grizzled laurel
#

AHAHAHAHA

grizzled laurel
#

I didn't even know ogre has been around for that long, jeeeeezusss

void condor
#

multiline is for future daz to tackle

grizzled laurel
#

who needs multiline text anyway

void condor
#

Ogre3d is ooold

green breach
#

didn't roblox used to use it? lol

grizzled laurel
#

my favourite game used to use ogre too

grizzled laurel
void condor
#

Im a little show-off and you need content for that

green breach
#

did you do a haxe 3d engine before cortex?

void condor
grizzled laurel
#

do you sometimes randomly go thru all the screenshots to feel the nostalgia? xD

void condor
#

it all kinda evolved out of my flash days

void condor
#

@random cedar actually knows. He was there πŸ˜„ FGL ❀️

grizzled laurel
#

xD

#

that does seem very fun to be able to do

void condor
#

fun fact: in my flash days I wrote a 2D editor which was 3D under the hood. It will get a new coat of paint for cortex. the core and logic will basically be the same

#

blast from the past

grizzled laurel
#

reminds me alot of "older" editors (like hammer)

#

this kindof realm

void condor
#

I grew up with these

grizzled laurel
#

yeah defo, wasn't this like the standard back in the day?

#

tbf, if i was an actual game designed I would probably prefer the older editors

void condor
#

brushes and baking everywhere

grizzled laurel
#

I utterly despise the unreal editor

grizzled laurel
#

especially 2011 era games (like portal 2)

void condor
#

baking was soo annoying

grizzled laurel
#

although the source engine (and derivatives) has done a great job of looking great even in modern times

void condor
#

im talking 1999-2008

grizzled laurel
#

Titanfall 2 is another good example of the source engine blessing a game

grizzled laurel
void condor
#

Thing is, brushes were quickly replaced / augmented with meshes once unified lighting models came along

#

These days I dont care anymore. I just model stuff in blender and my editor will be used for arrangements and gamelogic

grizzled laurel
#

i mean if it works it works\

void condor
#

brushes can force a certain aesthetic (clinical blocks, also no holes allowed, shit has to match geometrically perfectly). esp if you dont have advanced manipulation capabilities. See the difference between source 1 & source 2.

#

There is an elegance to it, for sure

grizzled laurel
#

yeah defo

#

i like old games

clear dome
#

Ceramic does have multiline text input, but it doesn’t have the scroll (yet)

void condor
clear dome
#

Regardless, all your work looks very cool πŸ˜„

void condor
#

ofc I wont rewrite the react madness, but instead do it old-school:

class DropdownMenu extends Control {
    var ctlTrigger:DropdownMenuTrigger;
    var ctlContent:DropdownMenuContent;

    public function new(_config:DropdownMenuConfig) {
        super(_config);

        this.addListener(Added, _onAdded);
        this.addListener(FocusIn, _onFocusIn);
        this.addListener(FocusOut, _onFocusOut);
    }

    override public function dispose() {
        this.removeListener(Added, _onAdded);
        this.removeListener(FocusIn, _onFocusIn);
        this.removeListener(FocusOut, _onFocusOut);
    }

    function _onAdded(_evt:Event) {
        if (_evt.phase == Bubble) {
            // something was added, check if it was one 
            // of our companion controls and grab them
            switch (_evt.target.tagName) {
                case 'DROPDOWNMENUTRIGGER': ctlTrigger = cast _evt.target;
                case 'DROPDOWNMENUCONTENT': ctlContent = cast _evt.target;
            }
        }
    }

    function _onFocusIn(_evt:Event) {
        if (_evt.target.parent == ctlTrigger) {
            // we focused something inside the trigger
            if (ctlContent != null) {
                // position the content
                // TODO: check available space and position accordingly
                ctlContent.style.left = VDimension(PX(ctlTrigger.left));
                ctlContent.style.top = VDimension(PX(ctlTrigger.top+ctlTrigger.height+5));
                // show the content
                ctlContent.addStyleClass('show');
            }
        }
    }

    function _onFocusOut(_evt:Event) {
        if (_evt.target.parent == ctlTrigger) {
            // whatever in our trigger lost focus
            if (ctlContent != null) {
                // hide the content
                ctlContent.removeStyleClass('show');
            }
        }
    }
}
void skiff
#

uhlala

neat smelt
#

I wonder who will make haxeui-cortex

random cedar
#

What is this, where am I πŸ‘€

ionic badger
void condor
neat smelt
void condor
ionic badger
#

oh wow, that was a year ago

neat smelt
#

i guess the idea would be to map haxeui to your eventual implementation, @void condor , to facilitate easy migration of apps from other backends to yours

#

for me just seeing a working text box makes me want to change from Heaps to Cortex

void condor
void condor
ionic badger
#

ceramic's textbox has a pretty decent base

#

and additional things are possible to add, i've added them locally but just not correctly πŸ˜†

pearl slate
void condor
void condor
pearl slate
void condor
#

there is literally nothing more life- & soul sucking than code for a textedit

pearl slate
#

ha, gotcha... 100% - its not really code ive EVER wanted to look at again... and its not RTF (as i think the Cortex version would / could be?)

#

like its a single font, single color, single size type of deal

clear dome
#

Ceramic’s online samples with the debug UI have it, for instance

clear dome
#

Double click should work too

#

Btw I don’t know how you architected that exactly, but I separated text selection from text edition, so you can make text selectable without having to make it editable, these are two different things

void condor
ionic badger
#

double click works as well, yes

void condor
#

also single font is the way it should be πŸ˜„

pearl slate
void condor
#

nobody has fun writing richtext editing

ionic badger
#

rich text would be cool to have, i'm not sure if ceramic textbox can handle that though, it seems to attach to a single Text object

clear dome
pearl slate
#

thats the only "colour change" that can happen - except for the defaults ofc

void condor
#

I call this multi color

ionic badger
#

πŸ˜†

#

Technically not incorrect

pearl slate
ionic badger
#

white text in the middle of black text

void condor
#

xD

#

im even more cheap

clear dome
void condor
#

my selection is rendered additively onto the text

ionic badger
void condor
#

today is bugfix day, lots of subtle fixes. I had some issues with text alignment that are all fixed and I also added some more eye-candy like font oversampling. It's not on the level of sdf but already much more pleasant

#

next are issues&review of alpha, scissoring, z-index & mousepicking. Found some interesting edge-cases that will get nuked away now

#

Then we are finally 90% in ui component land and I can build some crazy widgets

normal dagger
#

What you've shown is crazy enough already, nice job man

grizzled laurel
#

BTW, How do you handle tooltips in cortex-ui?

void condor
#

atm I dont have them, but once I add them, they'll use the same setup as the dropdowns: simple logic container with fixed position and high z-index

#

why u asking?

grizzled laurel
# void condor why u asking?

because the dropdowns reminded me of them and I recall you having a debug overlay and having something that sorta looks like tooltips

random cedar
void condor
#

oh, and CPPIA out of the box

#

most libs/externs can be used via cppia, so you can keep the app running, compile 2secs and see it auto-reload

#

and once you are done it folds all code into a clean optimized native build

#

aaaand another thing it does different: the whole project is setup as a monorepo with with multiple apps optionally sharing packages & assets while all dependencies are vendored in

#

at this point I think I can write a book

molten sleet
#

Any specific reason why?

hollow spindle
#

C++17 is pretty outdated nowadays\

molten sleet
clear dome
#

Meanwhile, shipping c++11 and binaries built with vs2012 because some clients need it blobimfine

clear dome
hollow spindle
#

I normally use c++17

#

But recently I've started using c++20

void condor
#

others like bgfx will also start to move slowly towards it

void condor
#

@normal dagger sure, that was an early iteration

#

cortex is the 3rd and final form

void skiff
#

what the heeeell

void condor
normal dagger
#

Oh wow

#

Kudos for the determination

random cedar
void condor
void condor
#

waaaaah

#

found a nice cleanup issue in the ui. also had to introduce stackingcontext marking

void condor
#

omg

#

in release mode this is some smooth shit

void condor
#

ok all issues are fixed.. feels weird

void condor
#

zero-sum game πŸ˜„

#

ok, last thing I need in the core is the transform-origin directive

void condor
void condor
#

At this point im almost straight up copy and pasting the shadcn markup into my xml macro... First iteration of Select done πŸ˜„

lethal talon
#

wow that's awesome

void condor
#

re-implementing the barebones essentials of DOM + CSS is finally paying off.

#
<Select>
    <SelectTrigger>
        <SelectValue class="outline" placeholder="'Select a timezone'"/>
    </SelectTrigger>
    <SelectContent>
        <SelectGroup>
            <SelectLabel>North America</SelectLabel>
            <SelectItem value="'est'"><span text="'Eastern Standard Time (EST)'"/></SelectItem>
            <SelectItem value="'cst'"><span text="'Central Standard Time (CST)'"/></SelectItem>
            <SelectItem value="'mst'"><span text="'Mountain Standard Time (MST)'"/></SelectItem>
            <SelectItem value="'pst'"><span text="'Pacific Standard Time (PST)'"/></SelectItem>
            <SelectItem value="'akst'"><span text="'Alaska Standard Time (AKST)'"/></SelectItem>
            <SelectItem value="'hst'"><span text="'Hawaii Standard Time (HST)'"/></SelectItem>
        </SelectGroup>
        <SelectGroup>
            <SelectLabel>Europe & Africa</SelectLabel>
            <SelectItem value="'gmt'"><span text="'Greenwich Mean Time (GMT)'"/></SelectItem>
            <SelectItem value="'cet'"><span text="'Central European Time (CET)'"/></SelectItem>
            <SelectItem value="'eet'"><span text="'Eastern European Time (EET)'"/></SelectItem>
            <SelectItem value="'west'"><span text="'Western European Summer Time (WEST)'"/></SelectItem>
            <SelectItem value="'cat'"><span text="'Central Africa Time (CAT)'"/></SelectItem>
            <SelectItem value="'eat'"><span text="'East Africa Time (EAT)'"/></SelectItem>
        </SelectGroup>
    </SelectContent>
</Select>
#

that's the dom. the individual elements might extend that with some internal stuff but nothing u as a user need to care about

#

the general rule of thumb is: Build the hierarchy of elements in markup, have the elements deal with events and logic basically.

#

The actual visuals, transitions & animations are all defined in CSS

#

HSS for the select content:

selectcontent {
    position: absolute;
    z-index: 5;
    padding: 2px;

    flex-flow: nowrap column;

    opacity: 0;
    background: $bg-primary;
    border-radius: $border-radius;
    border: 1px solid $txt-secondary;
    filter: CSS("drop-shadow(1, 45, #000000, 0.75, 6, 1, 30, 35, false)");

    transform: scale(0.5,0.5);
    transform-origin: left top;

    transition-property: opacity, transform;
    transition-duration: 0.25s;
    transition-timing-function: cubicOut;

    &.show {
        opacity: 1;
        transform: scale(1,1);
    }

    > selectgroup {
        flex-flow: nowrap column;
        flex-shrink: 0;

        > selectlabel {
            padding: 8px 6px;
            > span {
                font-size: $default-font-size * 0.9;
                color: $txt-secondary;
            }
        }

        > selectitem {
            padding: 8px 6px;
            border-radius: $border-radius;

            flex-direction: row-reverse;
            justify-content: space-between;
            gap: 10px;

            > .square {
                width: 15px;
                height: 15px;
            }

            &:hover {
                background-color: $bg-secondary-hover;
            }

            &:checked {
                > .square {
                    background-image: embed("../img/checkbox_white.png");
                }
                > span {
                    color: $txt-active;
                }
                color: $txt-active;
                background-color: $bg-secondary-hover;
            }
        }
    }
}
#

super easy workflow once you combine it with hot-reloading

void condor
#

OOOHHHH

#

This could actually replace my shoddy macros

void condor
#

You have no idea how mind-blowing this screenshot is to me.

#

and if you dont understand what's going on: this is an intact ui hierarchy with items like the select-content popping out of layout via z-index, automatically adjusting itself to available screenspace, activating the built-in scrolling all while nested in other overflowing controls all while event handling just does its thing all while the rendering correctly stacks depths, zindex, clipping&scissoring ... 🀯

void condor
#

omg

#

just realized we inherited support for mediaqueries from haxeui styles... I have to wire that up at some point

#

would instantly solve all the resizing bullshit with different resolutions

void condor
#

you know you reached peak ui programming insanity when you comfortably pick stuff out of transformation matrices to do some calculations

void condor
#

and then you delete everything again bc you realize you dont need fancy math

molten sleet
#

this is why im just gonna use imgui

#

*for debug stuff, i'll have to do ui eventually for lumina

void condor
#

why though, It's such a great learning experience

molten sleet
grizzled laurel
clear dome
void skiff
void condor
#

u mean in so far?

#

or in general

void skiff
#

in general

void condor
#

I spend most of my freetime on it and the engine. depending how much energy I have left after my job

#

last 2 weeks I spiked bc I have vacations πŸ˜„

#

most of the haxe stuff I use in cortex is stuff I wrote over the last decade remixed into a new form

#

that unification I started sometime last year

#

anyway, I reached all my milestones... now I sorta feel empty

#

arriving at that textfield, dropdown & select I can finally build my tooling

#

funky feeling

clear dome
ionic badger
void condor
#

Thinking about adding this to my UIMacro

void condor
#

lol, ok

#

templating confirmed πŸ˜„

ionic badger
# void condor

I have been very tempted to completely rewrite my chart stuff recently, It can do pretty much everything I need, it's just not very organised to integrate with

void condor
#

xD

tired ember
#

i have no idea if this is where i'm supposed to talk about this
but i'm trying to use linc_filedialogs for something made with haxeflixel (specifying that if it matters at all) and it seems to be throwing cpp errors:

Error: ./src/funkin/CoolUtil.cpp: In static member function β€˜static Array<String> funkin::CoolUtil_obj::showOpenDialog(String, String, Array<String>, Dynamic, Dynamic, Dynamic)’:
./src/funkin/CoolUtil.cpp:834:26: error: β€˜pfd’ has not been declared
  834 | HXLINE( 327)             pfd::opt option = pfd::opt::none;
      |                          ^~~
./src/funkin/CoolUtil.cpp:836:33: error: β€˜option’ was not declared in this scope; did you mean β€˜optind’?
  836 | HXLINE( 329)                    option = pfd::opt::multiselect;
      |                                 ^~~~~~
      |                                 optind
./src/funkin/CoolUtil.cpp:836:42: error: β€˜pfd’ has not been declared
  836 | HXLINE( 329)                    option = pfd::opt::multiselect;
      |                                          ^~~
./src/funkin/CoolUtil.cpp:847:53: error: β€˜linc’ has not been declared
  847 | HXLINE( 335)            ::Array< ::String > files = linc::filedialogs::open_file({

every error past this is just unrelated stuff breaking because of the stuff above breaking

the code i'm using that's failing is just this:

#if linc_filedialogs
var option:Option = Option.None;
if(multiSelect)
    option = Option.Multiselect;

final goodFilters:Array<String> = [];
for(type in filters)
    goodFilters.push(StringTools.replace(StringTools.replace(type, "*.", ""), ";", ","));

final files:Array<String> = FileDialogs.open_file(title ?? (multiSelect ? "Open Files" : "Open File"), initialPath, goodFilters, option);
return files;
#end

how do i fix this ??

tired ember
#

searching in the generated cpp code it seems like it's not including any of the headers

void condor
#

hmm, interesting

#

if you open the lib on disc, open FileDialog.hx and add @:include('linc_filedialogs.h') above every @:notNull you find and test again

#

which haxe / hxcpp version do you use?

tired ember
tired ember
void condor
#

Do you have -D HXCPP_CPP11 set?

tired ember
void condor
#

oh!

tired ember
#

i will when i get back from the store lol

void condor
#

not all enums had the include and that prolly is the cause. I didnt detect that since I used the icons which had it

void condor
void condor
#

just remembered an old trick in nanovg and now we can have tinted image fills! πŸ˜„

#

that will make skinning ui soo much easier

tired ember
# void condor pull again

oh yeah slightly unrelated this error comes up, had to comment it out myself to get it compiling any further

Error: /mnt/B64005D340059AEF/Refresh/Programming/Haxe/- HaxeFlixel/FNF-Troll-Engine/.haxelib/linc_filedialogs/git/linc/linc_filedialogs.cpp:3:10: fatal error: ./linc_filewatch.h: No such file or directory
    3 | #include "./linc_filewatch.h"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
#

this file isn't anywhere in linc_filedialogs

#

so

#

it's referencing a non-existent header

#

after pulling and fixing that line, i get this

void condor
#

fix coming

#

that's a copy and paste error, I have that header in my project, so didnt notice

tired ember
#

fair

tired ember
# tired ember

after removing that the latest commit doesn't help anything here

#

it no longer thinks the uh

#

pfd

#

it no longer thinks that doesn't exist

#

but now it's erroring for other reasons now

void condor
#

pull

tired ember
#

also just realized this specific project is using hxcpp 4.3.2

#

i forgot asbout that

void condor
#

#1234939525931728906 message

#

again, what about HXCPP_11

tired ember
#

as in the define wasn't actually defined

#

i'm testing latest commit rn

#

i think this is the exact same error log as i just sent but i'll send it again just in case anything's different

#

hxcpp error logs are so hard to track down to what's really happening 😭

#

the filewatch thing was fixed so

#

updating haxelib did work

#

i did notice there was no haxelib json

#

i don't know if that'd be an issue

#

but it could be since i recall having issues with using haxelibs without a haxelib.json file

void condor
#

no

#

your code is triggering an error

#

you should create a simple test app where you run the sample included in the readme

#

if that works then you do something in your funkin-thing that was not intended

tired ember
#

i'll go do that with a basic hxcpp project since those don't take long to comiple

void condor
#
./src/funkin/CoolUtil.cpp:892:1: error: mixing declarations and function-definitions is forbidden
  892 | , initialPath, goodFilters, _options);
      | ^
./src/funkin/CoolUtil.cpp:892:3: error: variable or field β€˜initialPath’ declared void
  892 | , initialPath, goodFilters, _options);
      |   ^~~~~~~~~~~
./src/funkin/CoolUtil.cpp:892:16: error: variable or field β€˜goodFilters’ declared void
  892 | , initialPath, goodFilters, _options);
      |                ^~~~~~~~~~~
./src/funkin/CoolUtil.cpp:892:37: error: expected initializer before β€˜)’ token
  892 | , initialPath, goodFilters, _options);
tired ember
#

wait a minute

void condor
#

goodFilters is not my code

tired ember
#

hm

#

why are those variables being declared as void

#

they aren't ??

#

wait

#

hold on

#

i might have to cast them because i noticed they are technically makred as dynamic

#

i'll still make a test project

tired ember
#

the weird part is it almost finishes

void condor
#

show your hxml

tired ember
#

with or without HXCPP_CPP11 doesn't make a difference

#

unless i typed it wrong

#

nope HXCPP_11 doesn't make a difference either

void condor
#

no this time it didnt compile the lnc_filedialogs.cpp and you are missing the o files

#

seriously no clue what you are doing there

tired ember
#

the actual main file is as you suggested, just copied from the readme sample

#

it failing on the main project could make sense, i might be doing something very wrong without realizing
but this is the simplest case i can test with

void condor
#

i'll check

#

gonna include a test that I verified

tired ember
#

would it help if i sent my test project over as well?

void condor
#

I think I have the issue, I can isolate it, but Im not sure I understand it since it behaves completely different in cortex

#

comment the #define PFD_SKIP_IMPLEMENTATION 1 in linc_filedialogs.h

#

I think I may have misunderstood how to use it correctly. the implementation gets compiled into the unit of the cpp file but that was enough for me. super weird

#

again, test it, im gonna reflect on it and try to make it break in cortex and then I can supply the fix and test

tired ember
# void condor again, test it, im gonna reflect on it and try to make it break in cortex and th...

i commented it out, and for good measure deleted the bin folder, now this happens (on the same testing project i made earlier)

everything up until this point goes as normal
 - src/hx/gc/Immix.cpp  [haxe,gc]
 - src/hx/Lib.cpp  [haxe,static]
 - src/hx/StdLibs.cpp  [haxe,static]
 - src/hx/Debug.cpp 
 - src/hx/gc/GcCommon.cpp  [haxe,gc]
 - src/String.cpp  [haxe,hxstring]
Link: Main
Error: Could not find build target "of"
Error: Build failed
#

i haven't changed the hxml at all since

#

i'm confused on whether or not it succeeded

#

it didn't seem to generate any nasty cpp errors after linking

void condor
#

haxelib run hxcpp cache clear

tired ember
#

WAIT i think i realized why
i just remembered it doesn't like folder names with spaces inside of them

void condor
#

this helps with header code sometimes not working

tired ember
tired ember
void condor
#

oh ok, dude, learn about the cache and set it, it will supercharge your native compiletimes

tired ember
#

i think it just doesn't like the folder name that the project resides in

void condor
#

...

tired ember
#

it usually spits that error out when there's spaces in the name

#

which is weird because it usually still compiles fine despite that

void condor
#

seriously for a sec I thought you were using vista

tired ember
#

lol

#

it's kde plasma with a really good windows 7 theme

void condor
#

hmmm

tired ember
#

i wonder how much this would do for the other project

void condor
#

im not pleased. ok I will commit that change and my test and then you can continue and I need to check wtf is going on with that define

#

pushed

tired ember
#

other project is still failing

#

i'll have to find out what the hell is going on with my code then

void condor
#

kk

tired ember
#

it's really strange because this is the code in question
this doesn't look like it should be going this wrong

#

i tried putting the title into a variable because at some point i was just trying stuff in hopes of it maybe working 😭

#

either way it made no diff

#

wait

#

no

#

i can just delete the export folder and it Should work

#

wrong reply damn it

tired ember
#

which is fixable

void condor
#

lol

#

title ?? "Save File"

#

move that out of the call

#

final filePath:String = FileDialogs.save_file("Save File", initialPath, goodFilters);

#

have fun

#

also filters can be null and will crash if you loop it

#

@tired ember ^

tired ember
#

i realized both of these shortly before this most recent compile

it's compiling right now, hopefully it works

void condor
#

it will

#

and setup the cache, 4s vs 31s compiles for me

void condor
#

added support for hss conditional compilation. allows easy an setup for independent light/dark themes

tired ember
#

yay it works

#

i misinterpreted what the initial path argument meant

#

i was trying to give it a default file name which i don't think is possible?

tired ember
#

update: it's only wanting to work on my machine apparently ??

#

what ???

#

this is only happening on windows specifically as well which is even stranger because i got it working on windows

#

ooh wait i think i might've figured out what's happening here
shell32.lib isn't being linked

tired ember
#

after adding a thing to link shell32.lib (along with a few other things just incase)
to Linc.xml() it worked

void condor
#

makes sense, I wasnt able to test everything under windows. PR welcome

tired ember
#

and they return an empty string

void condor
#

oh, why patch the haxecode, you could have just added it into the linc_filedialogs.xml

tired ember
#

i don't know actually, just fixed that

void condor
#

do you know which libs are a hard requirement?

tired ember
# void condor do you know which libs are a hard requirement?

i know shell32 was one of them, i didn't want to deal with more potential errors so i added some extra

on one hand, i can go back and remove the unnecessary ones but
on the other, i don't want to deal with windows right now
my pc genuinely hates being on windows 😭

#

i think one of them was also related to dialogs

void condor
#

ok, I think userenv is also required. I pull and clean up a little

tired ember
#

i don't remember which

void condor
#

pushed

#

I will revisit once I port the latest version of cortex back to windows

void condor
void skiff
#

warning: flashbang

void condor
#

It's soo nice how easy working with bgfx is

molten sleet
#

Something abt buffers and the build system

void condor
#

skill issue I guess?

#

πŸ˜„

pure oriole
ionic badger
void condor
#

at one point I gotta check how this whole preloading stuff works with a slower connection

#

But this working gives me huge confidence

grizzled laurel
#

Awesome!!

void condor
#

im so stupid

#

remember, if you create a server, make sure you also start it

clear dome
#

_if it doesn't start, it doesn't crash smart _

void condor
#

In this house here we dont crash

void condor
#

what a monster refactor

#

good things coming!

void condor
#

wow, the udprotean lib works soo nicely

void condor
#

ok, what a night

#

Finally I have a pretty good idea of what will be the first shippable project. For my editor architecture I opted for a 2 app setup, editor + game. They need to connect to eachother and exchange state and cmds. But since I have no idea how some shit is about to go down I decided to start smaller. Instead I will focus on statecharts first. I want to review and monitor them live in my projects...

#

maybe @crystal grove wants to do that as well? πŸ˜„

#

So, how about we take a page out of tracy's book and setup a debug-module that can be included with any project that uses my statechart lib, make it use fast udp networking and have a second app, a statechart debugger that connects and pulls all the data for visualization? This debugger can serve as a prototype for the real editor and I get to dog-food basically everything about cortex and put it through its paces!

#

Soooooo I decided to start hacking! I ported most of the stuff I had in HxGodot to cortex and improved some things along the way. It's still early but it fucking works already very well. Left is the game running with the debug-server, left is the connected debugger that currently shows the 3 types of active statecharts in the game. No realtime updates/animations yet since I gotta think on how I visualize all the active instances (can be a lot) πŸ˜„

crystal grove
#

This is better than me putting trace() in every single state transition

void condor
#

The best thing: the debugger will automatically layout ANY statechart into a nice graph

#

Here it is connected to the ui-demo app

#

What's even crazier is coding the server and the client at once. With the cppia reload this feels a bit unreal. The monorepo setup was really worth it

#

Another cool aspect is that I could record/log events & transitions and couple it with tracy, allowing deep debugging of the logic and the code

crystal grove
#

You said any project, so this can tie into js and others?

void condor
#

native only

#

at least for a start

ionic badger
#

udprotean has been on my to try list for years

#

it looked like such a good lib when i first saw it

grizzled laurel
#

I've used it before, worked wonderfully

uneven coral
#

idk if this is the right place to ask this but i tried cloning the submodules for linc_bgfx but it kept failing with Please make sure you have the correct access rights and the repository exists.

void condor
#

I guess if you dont have GH credentials then you cant clone that way

uneven coral
#

i see

void condor
#

hmm I might change that over the weekend, in the meantime you can change those git: uris to https and init the lib that way

uneven coral
#

alright thank you very much 🫑

void condor
#

lemme know how your adventure goes!

uneven coral
#

will do :D

clear dome
uneven coral
#

while attempting to compile the test provided, i get this error C++17 standard support is required to build.

#

is there any flag i can pass to make it use it or something similar?

void condor
#

Just use -D HXCPP_CPP17 in your hxml

uneven coral
#

thank you :D

void condor
#

I think I forgot to add that in the test

#

that test is super old, I hope it still works

uneven coral
#

had to make a few changes

#

adding the define still gives me the same error though

void condor
#

checking, 2 secs

#

oh yes, that test is from before I refactored most of the externs. 2secs, fixing everything

uneven coral
#

alrighty

void condor
#

if you lack shaders, just grab the ones you find in the bgfx samples or compile your own

#

looking at it, Im kinda glad that cortex abstracts most of that stuff away

void condor
#

having added yoga for the flexbox model is paying such huge dividends

uneven coral
#

i still get the C++17 error

#

even in the latest commit

void condor
#

hmm, that's weird

#

I guess it has to do with how bgfx deals with the __cplusplus definition

#

at some point I will need to review the whole define setup to make sure everything is fed everywhere correctly. On my end it works and is defined by hxcpp, but im running linux, so maybe I missed something for windows

void condor
#

compiling multiple cppia apps in a networking setup at once is such fun. not needing to restart server/clients and reconnecting is such a time saver πŸ˜„

uneven coral
#

so i think uncommenting those wont help

void condor
#

muahahaha

void condor
#

not perfect, but very functional πŸ˜„

void condor
#

ohhh bgfx received lots of good updates. they finally exposed the vulkan max descriptorsets config

#

instead of lod'ing my ui I can now just 10x that and throw an amazingly unresponsible amount of draw calls at vulkan

void condor
ionic badger
#

What linc_sdl bindings does the bgfx test use?

#

I tried the ones at snowkit but fails to compile

void condor
#

oh boy, dont use that

ionic badger
#

i think i got all the build steps done for bgfx

#

anything obvious missed here?

void condor
#

a define

#

try to add this define

#

lemme check if there are other changes that sdl needs and I havent moved out of cortex yet

#

ah yes

#

2 secs

ionic badger
void condor
#

yep. it's ugly

#

now I get why shit is just wonky

void condor
#

had to rip out that nativetoolkit shit

#

the config should now be included correctly and the bgfx test compile just fine

#

all this shit is precisely why cortex is a monorepo now and vendors everything. most stuff is soo bleeding edge that you end up having to modify 3-4 libs just make things work like they should

void condor
#

top!

clear dome
#

(I didn’t go as far as mono-repoing Ceramic but still totally understand why someone would do that)

ionic badger
#

So i see the test stuff has a lot untyped code in it - I'm assuming that's all necessary for the foundation to work?

void condor
#

the SDL_SysWMinfo stuff? yeah, it's stuff that even linc_sdl didnt expose properly.

#

depending on which platform config header gets included/setup, that struct's union will change and include different stuff

#

other than that, these are standard display/window pointers that bgfx needs to setup rendering contexts

molten sleet
#

Wasn't SDL_syswm.h removed in SDL3

pure oriole
#
void condor
void condor
#

hmm, this is soo much better than I had anticipated. packaging the desktop assets and hooking them up as a preload is super straight forward

ionic badger
#

@void condor If I wanna make a framework that's cppia "compliant" are there any patterns to avoid (outside of externs) Things like globals, singletons... common patterns like that, are they fine?

void condor
#

no special required. jsut make sure you have proper init / shutdown capabilities

void condor
#

ok, I think I finally have an idea on how I wanna tackle releasing cortex

#

the idea is roughly to have 2 versions of the engine, a community edition and a hidden one that I use

#

in terms of licenses, the code will be clustered into different areas with different licenses

#

first of all I wanna retain & respect the original sources(in case where i pulled something or I use a library fork)

#

the rest of original cortex's code might dual licensed, meaning the community edition will be a FOSS one and the hidden one might/can get a different license if there is any interest

crystal grove
#

Is the hidden version purely a licensing thing, or more like a dev/bleeding edge/don’t look over here kind of thing?

void condor
void condor
#

So, here is something fresh: Since we consider CSS files in cortex' UI system as kind of an assetpack, that "styles" a hierarchy (layouts, colors, fonts, (animated) visuals, ... etc) I thought it also kinda made sense to include sound-effects!

ionic badger
#

okay, that's a cool thing

#

instant game feel

void condor
#

yeah, super easy addition with big impact

void condor
#

[showcase] After quite some time, cortex has its audio backend back in action. So I decided to do something fresh: In cortex' UI system we consider CSS files as a kinda assetpack, that "styles" a hierarchy (layouts, colors, fonts, (animated) visuals, ... etc), how about we add sound effects via CSS as well? Said & done! Turns out it feels good! πŸ˜„

ionic badger
#

iirc you got debugging working with hxcpp - what method did you use? a native debugger or were you able to map to use source maps and debug the haxe code?

void condor
#

i debug native only

void condor
void condor
#

waah, ok I wrote two macros that convert an existing extern to json and the other converts that json into a new extern with all the cppia tricks

ionic badger
#

lol what

void condor
#

had to make hxraudio cppia compatible

void condor
#

Another interesting observation: Ever since I switched to a monorepo, I experience less mental friction when it comes to dependencies or incremental refactors since I stopped worrying about branching&updating various parts of the codebase. Instead, after a fun weekend coding, I have this new sunday morning routine of going through, sorting and commiting a shitton of changes

clear dome
#

Some developers would get instantly mad at this, but I think it mostly boils down to what’s important in your workflow. For a solo project like Cortex, it seems to perfectly make sense. People often see problems they had in their own context, and project that to your own without much thought

void condor
#

thing is, even the best libs come with assumptions and these impose constraints. most of the time these constraints get in the way of solving things the "right" way(context sensitive). Solo project or not, doesnt matter, happens either way. Think of !Billy and the ceramic textfield. if you throw away these artificial shackles things get a lot more, shall I say, fluent / productive? It's essentially all about embracing the forks πŸ˜„

void condor
clear dome
clear dome
# void condor though Im interested about the "getting mad" part. In your opinioin, why would a...

I’m mostly thinking about the « good practicesΒ Β» that professional developers have a tendency to enforce, even on contexts they are barely relevant. In the case of monorepos with forked third party libs, some might get scared very quickly of « going out of syncΒ Β» from the « officialΒ Β» dependencies, because that’s the opposite of what they may be used to do, or what they might have learnt at school. But it’s all about context and knowing what are the costs and the benefits of what you are doing anyway

#

As far as I’m concerned, I’m generally used to fork and modify open source dependencies, because I accepted that in many situations, those libs authors didn’t need what I need, which is ok, they have been nice enough to share their work as open source for anyone to continue from there however they want. So, « avoiding the forkΒ Β» at all cost is somewhat silly to me, but I have seen that mentality a lot in my career

#

… and having a monorepo with less and less different git dependencies/submodules is definitely compatible with forking for your own needs πŸ˜„

clear dome
#

(And by the way, I could really see the benefit of removing some layers of git submodules toward something more monorepo-ish, to make that even easier)

ionic badger
#

Unnecessary mental effort for no reason in the end. Better to just not be organised and do it wrong, then when it's clear go back and refine. That's how I'm currently looking at the 'better approach' now anyway

clear dome
#

That’s what I do now: any utility I create is specific to the project that needs it. No need to make it generic, just make it work for the purpose you need right now. If later it makes sense to extract it to make it a more standalone/generic utility, all the project-specific work done beforehand will be very useful. Exceptions to this are projects I know from the start will be used in multiple projects and are large enough to be their own thing. But even Tracker lib first started as a thing that is part of Ceramic. Only at a later stage I decided to make it a separate project, because I needed it outside of Ceramic

ionic badger
#

does cppia naturally have a leak or is it my externs? πŸ˜„

ionic badger
#

running through valgrind (first time) and i'm not sure the leak are my externs πŸ€”

#

i've also got socket stuff in here which has nothing to do with me

void condor
#

every reload creates a new set of types. these types are versioned and on top if you dont clear all instances you keep old code around/active on top

ionic badger
#

if that's the case my first run shouldn't leak right?

void condor
#

define "leak". if the gc keeps a dead memory pool around that is supposed to be reused do you consider that a leak? Not really

ionic badger
#

around .1mb every 1 minute

#
==73594== LEAK SUMMARY:
==73594==    definitely lost: 44,466 bytes in 586 blocks
==73594==    indirectly lost: 343,420 bytes in 4,473 blocks
==73594==      possibly lost: 6,146,296 bytes in 4,053 blocks
==73594==    still reachable: 19,292,983 bytes in 24,235 blocks
==73594==         suppressed: 0 bytes in 0 blocks
``` from the valgrind run
void condor
#

Switch on the GC telemetry and ask it what it is doing and correlate that with valgrind. Tracy memory profiler can also help isolating addresses / objects

ionic badger
#

ohhhhh guess i have to recompile tracy πŸ˜„

#

forgot memory profiling was available there

void condor
#

the question is if you see a saw tooth in your memory graphs or not. You might observe there how the gc grows/manages it's budget according to your usage

ionic badger
#

Error: In file included from ./src/cpp/vm/tracy/Cppia_TracyProfiler.cpp:6:
/home/j/Documents/Projects/cpp/MyProject/haxe_modules/hxcpp/include/hx/TelemetryTracy.h:9:10: fatal error: /home/j/Documents/Projects/cpp/MyProject/bin/obj/linux64-debug/__pch/haxe/hxcpp.h: No such file or directory
9 | #include <hxcpp.h>
| ^~~~~~~~~

#

I compiled latest tracy which is 0.12.2 and it looks like haxe ships 0.12.0 - I'm guessing that's what the issue is here?

#

lol silly question, they're completely detached at this point πŸ˜‚

void condor
#

waaaaahhh

#

turns out I can add it to Steam as an app and force proton as compatibility layer

#

wow, the dude invested a shitton of time into this. every sample comes with indepth explanations and if you click on the hyperlinks the ui will slowly transition over to show you the setting

#

Ok. I loved the original version but this is A LOT better and offers 3D effects. Now that he has opensourced the c-lib for loading and running these effects together with a sample vulkan renderer + shaders I might just try to port this to bgfx and have this as particle effect solution in cortex

ionic badger
#

I'm trying to run my app through lldb and for some reason the cppia script doesn't run but host boots up

#

same thing occurs when trying to run through gdb

#

have you had a similar issue at all?

void condor
#

depends on what exactly you are doing

#

I always run the host, since it loads the script. And I can step through the execution. You might wanna explore the DBGLOG macro since it will print all kinds of useful infos about your script-execution

ionic badger
#

App was crashing on the client side, so I wanted to catch the error so I ran gdb Main-debug(host) and app booted without loading the script

#

also, with your native externs, you have the cppia side and the the non cppia side, how do you create an api that is identical between cppia and normal hxcpp? do you have an additional layer of wrappers in cortex?

ionic badger
#

Ohhh, i think I might understand, in the native api we use cpp.RawPointer for our method params, returns etc and then we can use Pointer.fromRaw in the cppia wrapper?

#

Do i have the right idea here?

#

hmm... not sure that's correct either

void condor
#

@ionic badger There isnt really anything special. It's all in my bindings. If you want we can hop on a call + screenshare and we take a look what you doing

ionic badger
#

I don't think i'm that far off

#

aahhhhh i think i might have just found it

void condor
ionic badger
#

you take in cpp.Star for where things want cpp.Pointer

#

I'm good with a call either way, I have a funky puzzle going on πŸ˜„

void condor
#

where you wanna do it?

ionic badger
#

i don't mind, can do it on the discord

#

people can come idle watch if they want

void condor
#

cool, ill be there in a sec

#

getting a drink

ionic badger
#

i'm gonna be around 5 or 10 mins, just sorting out some meal prep

void condor
#

kk, then I have a quick smoke as well

ionic badger
#

do you happen to have a workflow for developing cortex within cppia? because i'm assuming it gets compiled into the host, is there a way to still get hotreload support?

void condor
#

cortex is only partially compiled into the host

#

only the low-level parts involving externs

#

all other stuff is in the script

ionic badger
#

ohhh very smart!

#

ahhhh, i think some of my things are importing things into the host by proxy :/

void condor
#

I move stuff gradually over to the host as it gets finished

ionic badger
#

Ohh, I guess I can do App init on the client can't I πŸ€” My current setup had a simple cppia reload script built into App init if scriptable define is set

void condor
#

Wanna see something funny?

#

I was wondering what happens if you combine lighttpd (webserver), CGI (old but good) and cppia?

#

well, you get an interesting base for a webframework

#

I wonder what happens if I juice this up with some macros, htmx & tailwind

#

although, fuck tailwind πŸ˜›

ionic badger
#

what's the perk of cppia and Web dev? can't you hot reload js?

void condor
#

in this case it's not about hot-reloading. it's about 1000x reduced complexity and server-side native runtime speeds

#

it's like a lightweight php

#

also js is banned/illegal in this framework aside from what htmx offers

ionic badger
#

can probably use interfaces to remove more library code from the host πŸ€”

void condor
#

waaaah

#

after 1.5 years my console has finally a scrollToBottom πŸ˜„

void condor
#

@ionic badger and it leverages the events, anytime a child resizes we make sure our anchor at the bottom of the console log is in view:

scroll.addListener(Resize, (_evt)-> {
    if (_evt.phase == Bubble)
        anchor.scrollIntoView();
});
void condor
#

hmmmm, still contemplating on how I wanna have my workflow between game and editor look like

void condor
#

architecture-wise it makes sense for the game to have some editor capabilities, like you need to toggle debug vis and you want to interact with and inspect some stuff

#

guess I focus the whole asset handling first

void condor
grizzled laurel
#

nah im deleting my messages now, other people need to joy of hearing this without any spoilers. This video is too insightful

void condor
#

good call πŸ˜„

clear dome
neat smelt
#

it's important to have a variety in that regard. sometimes you want it, sometimes it's best to go a road less traveled...ass it were

ionic badger
#

Hey Daz, with haxui and cppia. How'd you go about getting haxeui stuff in the host? If I do the include I get macro conflicts and if don't recurse it, I get link errors on the client. Also did you do Toolkit init on the host or the client?

void condor
#

I think I plastered the problematic haxeui parts with #if ... or something

ionic badger
#

dang it, that's what I think I did and was hoping you had a better solution πŸ˜„

#

do you exclude the problematic parts from both scriptable and cppia or just the scriptable side?

ionic badger
#

can't figure out what to exclude, if i exclude macros, it messes up with the components

void condor
#

In other news: I finally have another week of vacation now

#

Oh, and Im hiring. If you know smart folks that match my attitude, be sure to lemme know

#

german language & locate south west germany a must

ionic badger
#

Oh, and Im hiring. If you know smart folks that match my attitude, be sure to lemme know
semmi πŸ™ˆ

green breach
#

yes hire semmi

void condor
#

not yet. Im still disappointed. He told me he thought Im part of the FNF crowd

#

πŸ˜›

#

the exakt german quote is even funnier & insulting #development message

ionic badger
#

lmao

ionic badger
#

CallMember haxe.ui.components._VerticalScroll.VerticalScrollLayout (0x5da2da2dce14 0x5da2df9846a0) 'get_verticalSpacing' fallback
What does this error on cppia client mean? I thought it meant there was a problem with finding the class but if i look in the export file, the files are all compiled on the host

void condor
#

is the getter inlined?

ionic badger
#

VecticalScroll (Module) -> VerticalScrollLayout extends DefaultLayout extends Layout I think all the functions are under layout

#

dce is off

#

Layout is present in the export file

ionic badger
#

another question, If I want something to be compiled in the client (and it is available through libs) shouldn't it automatically get compiled into the client if used?

#

Invalid super class 'simple.Rectangle' for 'TestClip'.
simple/internal/RenderLoop.hx:72: Exception: Missing super class
Called from cpp.cppia.Host.runFile (cpp/cppia/Host.hx line 45)
I'm getting this, where it seems to not be able to find the parent - but it should be able to just compile that class - no?

void condor
void condor
#

great, us-aws-east-1 is down and half the internet is broken..

void condor
#

ok, my brain is slowly drifting into 3D problems

#

which is a good sign

#

I need a nice material system that spans from visuals over physics to audio

neat smelt
#

(they were just cheaper)

void condor
#

@green breach gonna look into your castle PR now

#

anybody got a clue if shiro actually ships cdb files or if they just use it for dev?

#

hmmm, they shipped dat files and with wartales they switched to pak files

green breach
void condor
#

hmm, I might just pull things apart

void condor
#

ok, one these moments where i wish there was goto in haxe

green breach
void condor
#

I hate everything nodejs so hard

#

I cant even get electron to install properly

void condor
#

AAARGHH

#

Im getting angry

green breach
#

I didn’t really have any problems with it

pure oriole
void condor
#

electron installs just lock themselves up

#

classic nodejs version bullshit

#

but im not messing with that

#

I downloaded the windows version and started it through steam

green breach
#

LMAO

molten sleet
void condor
#

My brain is sooo unhinged sometimes

grizzled laurel
#

"sometimes"

pure oriole
void condor
#

in order to get the first editor iteration done, Im testing the prefab pipeline that is based on blender + gltf, but since I dont wanna do the composition of entities in blender manually I wanna checkout how to marry it to a central castledb database. For the cdb iterations I need my castledb editor but it is fucked for me under linux and I have to run it via steam+proton and it looks like ass. So I go ahead and study the whole editor code in detail and figure that it is possible to be re-written as a cortex ui application since I have all important stuff.... except a multiline textfield, so I look what to do to make that work and to do it endgame "right, once and for all" I need to replace the whole nanovg rendering backend with vg-renderer and integrate it with Skribidi for font, textshaping as well as its text editor....

So from looking how I could build levels I ended up back in UI land. unhinged, what can I say, a normal day in my brain

grizzled laurel
#

and do you reckon that cdb is capable enough to scale, even if you decide to make games that are currently wayyy bigger than what you are currently targeting (in terms of the "size" and/or "scale" of game)?

#

Personally I've never used cdb, so genuinely curious how well it can hold up

pure oriole
#

what is the thing that cortex cannot do bleh~1

void condor
#

here is a fun fact: castledb drives all shiro games. All of them. ncannasse initially set it up as a pretty small json based DB but had plans to make it run on sqlite in case where the dynamic json db wouldnt scale anymore (there is some old code hidden) but that was never necessary

grizzled laurel
green breach
#

Reading castledb source is an interesting look into the brain of ncannasse

grizzled laurel
#

very smart guy

grizzled laurel
#

but with the nice "frontend" of CDB

#

that makes sense, good choice

green breach
# grizzled laurel very smart guy

Good developer too. He just lives in a different bubble than the rest of us. We all have pretty similar styles given we have roughly the same influences.

void condor
#

also a unified material system

#

I have it all laidout. now I just need to rewrite the castledb editor

grizzled laurel
#

I never would've known it is that powerful

void condor
#

if you bought any shiro game, you can unpack the *.pak files and checkout their cdb files

grizzled laurel
#

I don't think I have... yet atleast sunglas

#

I'll defo check out CDB sometime though

#

seems like it's pretty cool (and more powerful/flexible than what I initially assumed it would be)

green breach
#

Just integrating LDTK sounds better to me

void condor
#

fuck the level editor

#

nobody needs that

green breach
#

lol

void condor
#

Im kinda toying with the idea to compile the cdb-lib down to python so I load cdbs & use them directly in a blender plugin

#

then the game/editor/blender work on the same source of truth

#

and blender materials can directly link to cortex materials etc

#

anyway, I have some unhinged coding to do

void condor
#

tweaking debug visuals

ionic badger
#

Error: In file included from ./src/cpp/vm/tracy/Cppia_TracyProfiler.cpp:6:
/home/j/Documents/Projects/cpp/MyProject/haxe_modules/hxcpp/include/hx/TelemetryTracy.h:9:10: fatal error: /home/j/Documents/Projects/cpp/MyProject/bin/cppia/obj/linux64-debug/__pch/haxe/hxcpp.h: No such file or directory
9 | #include <hxcpp.h>
| ^~~~~~~~~
compilation terminated.
Trying to use tracy, any ideas what's going on here?

void condor
#

not sure why the include is there. I think under windows the include paths are different

ionic badger
ionic badger
#

wasn't there a way to get it to to map directly to the haxe code? its mapping to the cpp code for me?

void condor
ionic badger
#

I am using tracy 0.12.2 if that matters?

ionic badger
#

Oh wow, affinity has merged all of its apps into a single one and it will be completely free

green breach
#

Huh neat. Wish it had Linux support

void condor
#

hmm, sad. free never means free. free means they pivot to user-data, most likely ai-services