pouët.net

Go to bottom

DemoSystem - A simple demo framework

category: code [glöplog]
The only reason "demosystem" has a framerate limit is because it's rotating objects with "x++;" ;)
added on the 2023-01-26 17:59:08 by Gargaj Gargaj
ah, the old good fixed-vsync rate platform approach :)

reminding me of DOS stuff solely using VGA vsync poll for frame synchronization, eventually slowing the pace down if retrace is missed :)
added on the 2023-01-26 19:31:43 by wbcbz7 wbcbz7
Adapt algorithms to be a function of time so you can play backwards etc and at different speed. Helps a lot debugging. Obvious problems effects with physics, but can precalculate positions etc, after all its a demo
added on the 2023-01-26 21:25:20 by Navis Navis
Thanks anyone for the feedback, I really do appreciate it! Even though it looks like 'bashing', it does point me to the right direction of where this should be headed next update comes around! Thank you for the time you took to look at the code and how this is modeled, and outline improvements on how this should be structured! :)
added on the 2023-01-27 18:30:01 by Defiance Defiance
Quote:
But I'm open to suggestions.

Surely you have considered TOML?

I'm quite happy with it lately for most application configs and even as a human-extensible serialization format in some cases.
added on the 2023-01-30 20:14:13 by Y0Gi Y0Gi
will try :) thx!
added on the 2023-01-30 21:39:25 by NR4 NR4
Quote:
Quote:
But I'm open to suggestions.

Surely you have considered TOML?

The 90s called and want their INI files back ;)
added on the 2023-01-31 01:13:25 by raer raer
Bikeshedding in full force.
added on the 2023-01-31 01:47:36 by Gargaj Gargaj
@Gargaj : I learn so many colorful "technical english" expressions from your posts, it's ridiculously fun ! Please write amusing, "coder-culture" stories. (actually not joking here)
added on the 2023-01-31 10:52:12 by TomS4wy3R TomS4wy3R
We had a couple of "scene fiction" stories in Hugi:
- A Scenish Tale
- PsychoJournal
- The King of the Scene
added on the 2023-01-31 11:09:58 by Adok Adok
YEAH ! Thanks a lot Adok ! I'm gonna read this and comment ! :D (also, I may have already read some of them (?) since I used to read diskmags A LOT back in the days, we'll see !)
added on the 2023-01-31 11:15:53 by TomS4wy3R TomS4wy3R
"PsychoJournal" is the funniest of the three, though clearly on the unrealistic side... It made me laugh several times (the insane ambitions, the extent of the thing, etc). Also : you know that feeling that Internet has turned to shit these last ten years ? That because Filipe's software has been made available to corporations, and they're not even able to make it work properly ! That's why. :D "Luckily", chatGPT is coming...

The idea for "A scenish Tale" is a bit nostalgic, and seems like a classic "life experience" for many 90ies guys. The end twist was nice.

"The King Of the Scene" seems more like an inside joke. Funny, but not that much.

All in all : actually not bad ! Your style is a bit on the dry side, yes. But you always keep action going, which is a good thing for this kind of writing.
added on the 2023-01-31 12:32:33 by TomS4wy3R TomS4wy3R
The config implemented is, as mentioned, for dev purposes and mostly to try different settings on the fly without recompiling the exe all the time. That's why generating the config file is turned off by default. Now then, I tried implementing an .ini library but the size of the framework became significantly bigger for something as trivial as the configuration file. I wanted the framework to be as much simple and small as possible, hence a small config file with only the important values.
added on the 2023-01-31 13:33:39 by Defiance Defiance
For actual demo development you will want a way to change a bunch of stuff without recompiling (think: shaders, camera positions, textures, effect parameter values etc). Even a minimum solution for that is a lot bigger than loading some config values.
added on the 2023-01-31 13:37:26 by Preacher Preacher
Preacher, I agree. When all this comes to the table, I will have to look at solutions like TOML, etc. Another thing I'd like to mention is that the IDE that was used was Codeblocks and particularly this version which features the x64 compiler so that people can edit and/or compile it for themselves.
added on the 2023-01-31 13:48:24 by Defiance Defiance
Any reason for not using, y'know, Visual Studio, being the most widely used and free IDE?
added on the 2023-01-31 15:27:47 by Gargaj Gargaj
None, in particular. Maybe I prefer more indie developed tools, I guess.
added on the 2023-01-31 15:35:10 by Defiance Defiance
Quote:
Any reason for not using, y'know, Visual Studio, being the most widely used and free IDE?


I prefer VSCode.

Visual Studio is loading forever, has shady menus for simple tasks like compiler options, its code completion sucks big time & also its installer / login required behavior is just awful. And is it really free? I remember it had a pretty decent price tag, but I could be wrong nowadays.

IDE is a matter of personal preference tho and frameworks should not require you to use a specific IDE imo. Some want the bloaty annoying-to-control "I only have to press F5 and the demo runs" experience, others like myself just want a smart text editor that's not in your way when you're controlling stuff manually / with CMake.
added on the 2023-01-31 16:40:57 by NR4 NR4
My preferred (and simple) solution for updating things on the fly without (mostly) recompiling:

+ "Reload" shaders every 1 sec while playback. Edit shaders through visual studio and save on the fly.
+ Have a multitude of input values from mouse/keyboard or midi (see Nanocontroller2 by Korg). Then in code you can say (for example):

glTranslatef (input->value[0], input->value[1],0.0);

value[xx] are mapped to your midi controller or mouse. Your display also shows the values of these things, so when you're happy you can hardcode them (* use no other external files for storing this info). You will then write:

glTranslatef (0.525,-6.51,0.0);

and move on to the next "problem". Obviously you want to solve one problem per run, such as (in this example) the placement of the object.

Then, have the following options, again mapped on midi:

A key to pause or unpause (DeltaT=0)
A key to move time forward and backward by half sec
A slider to move "cue time" (in seconds)
A key to run time from cue time.
A Slider to control speed (from 10% to 200%)

You mostly will be using pause / cue and run. IT becomes second nature.

--

I hardcode everything - there is no config or camera path files etc. - but then again the shaders are themselves some sort of "config" file if you think about it.
My "fade outs" would never be in C++ code, but in shader:

if (time>10.0)
gl_FragData[0].xyz*=clamp ((time-10),0.0,1.0);
added on the 2023-01-31 16:41:33 by Navis Navis
Quote:
And is it really free? I remember it had a pretty decent price tag, but I could be wrong nowadays.

Has been since 2005.
Quote:
IDE is a matter of personal preference tho and frameworks should not require you to use a specific IDE imo.

If it's something intended for beginners, swim with the mainstream for the beginners' sake.
added on the 2023-01-31 16:46:36 by Gargaj Gargaj
y no imgui? :)
added on the 2023-01-31 16:55:46 by smash smash
imgui is fantastic. It really is. Add that into it as well..
But having a live gui with sliders is a pain in the ass because you have to move the mouse, click on things, move the mouse back to some other code, focus/refocus etc. Best to use left hand for twicking and right for coding. I'll send a photo...
added on the 2023-01-31 16:59:06 by Navis Navis
BB Image
added on the 2023-01-31 17:01:46 by Navis Navis
nanokontrol2 <3 you can also doodle some nice acid with it while Defiance is working on version 1.01b of Simple Demo Framework(TM)
You need to be able to run both hands in parallel and independently. So better not skip your scales practicing on the piano.
added on the 2023-01-31 17:15:46 by Navis Navis

login

Go to top