Heavyweight window issue


#1

I’ve managed to get my studio’s rendering code embedded into a heavyweight window in a Juce app, which is obviously super excellent.

However, as is traditional with this sort of thing, there is a weird issue I’m facing.

If i create this window at the very end of the app’s initialise function, my main window doesn’t render properly; first of all, the whole document window doesn’t appear to repaint until i resize it, but also the menubar has no text on [even after resizing - the menu headers highlight, and the popupmenus are fine, but the menu headers don’t show any text at all].

I tried to use an asyncUpdater to delay the window creation momentarily, but that didn’t work. However, if i create it from a timer callback, it’s okay - even if I use startTimer(0).

So, it feels like I’m safe to hook all my rendering-core initialisation stuff into a timer callback, but at the same time it sort of feels like i might be asking for trouble.

Does this seem like a normal way to have to do things?

[FWIW I’m planning on having a separate thread for all of that stuff, but i thought i’d at least prove that i can get it to show in the first place before i did that. Would the separate thread be likely to make this a non-issue?]

I just can’t figure out why the text doesn’t show up on the menu headers, but perhaps someone might have an idea


#2

Sounds like there’s something in the other code that needs the window to be fully visible to work properly. I’d suggest putting something in your paint method so that the first time it gets called, it triggers an asyncupdater. Unlike a timer, that’ll definitely never happen before the window is actually on-screen.


#3

it’s very very strange.

If i initialise my rendering stuff AFTER i’ve created and added the windows (at the end of initialise()), then the app’s document window doesn’t draw properly until i resize it manually - but the menubar headings have no text.

If i initialise my rendering stuff BEFORE creating the windows, then the same thing happens EXCEPT… the FIRST menubar heading is present and fine, but the rest are blank.

Very strange.

The timer thing worked because my rendering init was called from the timer thread. I’ve changed it all so that everything to do with the rendering core stuff is on its own thread and it works fine [oddly easy in fact, especially considering how much of a ball ache openGL is to get working on its own thread!]. I am now, of course, forced to do a multi-thread app, which i’d prefer not to have to bother doing! I guess it’s not a truly bad thing though; if it were a game or something, i’d be over the moon, but as it’s going to be heavily driven by Juce UI events (rather than some logic i could simply drive from that thread) I guess I’m gonna be locking sh*t up all over the place.

Ho hum!

[addedum: i guess it’s probably to do with the fact that the core i’m using is more than just graphics; it’s got its own internal memory and thread management stuff, so i presume it’s confusing matters when preparing the ‘current’ thread on init - and the init procedure is not something i can really tinker with for this project at this stage]