These are chat archives for Devisualization/window

1st
Feb 2015
Stefan Koch
@UplinkCoder
Feb 01 2015 11:25 UTC
no worrys
could you tell me how to start using devisualistion ?
I am really not a GUI person :)
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:29 UTC
Keep in mind this is not a GUI library
Stefan Koch
@UplinkCoder
Feb 01 2015 11:29 UTC
what is it then ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:29 UTC
window + context creation
Stefan Koch
@UplinkCoder
Feb 01 2015 11:29 UTC
what's a context ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:30 UTC
OpenGL/DirectX
Stefan Koch
@UplinkCoder
Feb 01 2015 11:30 UTC
ahm could you elaborate ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:30 UTC
I'll summarise the parts
Stefan Koch
@UplinkCoder
Feb 01 2015 11:31 UTC
ok
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:31 UTC
there is nothing too special about window creation. Basically its divided into two parts, the actual window reference and the event loop
in WinAPI/GDI this is a raw window but you can utilise native GUI controls provided by GDI. Like a menu and a button
the event loop grabs events from the underlying system and makes them available to your code. Everything from on draw, to on key press
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:36 UTC
once an OpenGL context is created then you are free to basically render anything you want
Stefan Koch
@UplinkCoder
Feb 01 2015 11:38 UTC
so there is no convenience stuff, like check if the mouse if over the thing i just drew ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:38 UTC
you can get the mouse position in the underlying API. I've chosen to do mostly set and not get however
If you can't store it by the events, you are probably doing something that isn't 'common'
Stefan Koch
@UplinkCoder
Feb 01 2015 11:40 UTC
I want to visualize the process of compilation :)
but I have no GUI Foo whatsoever
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:41 UTC
just as an example. For Devisualization.gmaterial, in my wrapper over a Windowable. It auto adds an on resize event handler. Just so it can update and store the current window size. https://github.com/Devisualization/gmaterial/blob/master/source/opengl/devisualization/gmaterial/opengl/window.d#L190
Stefan Koch
@UplinkCoder
Feb 01 2015 11:43 UTC
the if {} else { bla } construct looks strage, do you have a reason to write it this way
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:43 UTC
which lines?
Stefan Koch
@UplinkCoder
Feb 01 2015 11:43 UTC
208
and 212
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:43 UTC
ohh checkSetup, it is a bit
but it does help my head a little bit
Stefan Koch
@UplinkCoder
Feb 01 2015 11:45 UTC
I'm not criticizing just wondering :D
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:45 UTC
thats ok, I think I ported that over from DOOGLE shrugs
Stefan Koch
@UplinkCoder
Feb 01 2015 11:46 UTC
well thanks for the Q&A
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:46 UTC
no problem
although, I think for your case. GUI might be a bit overkill. Perhaps web based instead?
Stefan Koch
@UplinkCoder
Feb 01 2015 11:48 UTC
The visualization will be pretty complex. I want kind of an interactive flow chart. So you can see branches an stuff
and where data is flowing
I have so much debug data in form of Control-and-Data-Fow-Graphs printed on paper ... I cannot open the door of my workroom anymore
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:51 UTC
interesting
Stefan Koch
@UplinkCoder
Feb 01 2015 11:53 UTC
I need something where I can zoom in and out. and where I can mark paths
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:54 UTC
have you seen graphiz?
Stefan Koch
@UplinkCoder
Feb 01 2015 11:54 UTC
yeah
it's not interactive
and it's too slow
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:54 UTC
oh
Stefan Koch
@UplinkCoder
Feb 01 2015 11:54 UTC
too hard to integrated with my stuff also
no D binding
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:56 UTC
I'm not too CSey so there is no chance for me to write something like it
or mathey for that matter
Stefan Koch
@UplinkCoder
Feb 01 2015 11:56 UTC
something like graphviz ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:56 UTC
but you will need at the very least some way to calculate curves
the curves are hard, because you want them away from other lines ext.
positioning the "blocks" or whatever they are called, are much easier
Stefan Koch
@UplinkCoder
Feb 01 2015 11:58 UTC
hmm that is good advice
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 11:59 UTC
writing a shader which draws some outline / highlight ext. is simple
Stefan Koch
@UplinkCoder
Feb 01 2015 11:59 UTC
I am a compiler guy, really. I have no clue of drawing and stuff
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:00 UTC
Capture.PNG
here's my current "shadows" for a papersheet
ignore the blue, thats just background color
Stefan Koch
@UplinkCoder
Feb 01 2015 12:02 UTC
the left shadow looks good to me
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:02 UTC
to me it looks awful, but better then nothing
Stefan Koch
@UplinkCoder
Feb 01 2015 12:03 UTC
can you make animations ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:03 UTC
they aren't hard
Stefan Koch
@UplinkCoder
Feb 01 2015 12:04 UTC
like a to boxes and a an arrow where the line of the arrow flows from one box to the other
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:04 UTC
just need some counter that resets at a set number, using onDraw as an iteration
one thing that might interest you is my LineGraph in Devisualization.Util https://github.com/Devisualization/util/blob/master/source/core/devisualization/util/core/linegraph.d
give it control points and it'll allow you to get the points based upon it using a step
so a control point might be a line destination or bezier curve points
Stefan Koch
@UplinkCoder
Feb 01 2015 12:07 UTC
and could I move a thrid box along that arrow ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:08 UTC
Devisualization.Scenegraph should allow that
I do recommend starting with just working out the curves, then moving to a rendering engine
most likely also some form of loader
Stefan Koch
@UplinkCoder
Feb 01 2015 12:10 UTC
oh boy.
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:10 UTC
thats before GUI's
Stefan Koch
@UplinkCoder
Feb 01 2015 12:11 UTC
I have enough on Hands with just debugging faulty codegen :worried:
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:11 UTC
once you know, what you want where it's simple GUI wise
I found something
Stefan Koch
@UplinkCoder
Feb 01 2015 12:15 UTC
I skimmed it
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:17 UTC
it looks like a reasonable port
Stefan Koch
@UplinkCoder
Feb 01 2015 12:20 UTC
thanks for the link
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:20 UTC
we really are digging things up from the grave Aren't we
one thing about that is, it is GPL
Stefan Koch
@UplinkCoder
Feb 01 2015 12:23 UTC
so what. it's only for debugging not to be included in any product
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:23 UTC
just restrictive
Stefan Koch
@UplinkCoder
Feb 01 2015 12:24 UTC
I think it is worth do pull this thing of the grave
I could do a reimplementation in D
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:25 UTC
I was thinking about cuves
curves*
you can calculate points upon a curve, if you have the start, middle and end
so atleast three
Stefan Koch
@UplinkCoder
Feb 01 2015 12:27 UTC
sure if the curve is monotonous
2 referenced in 1
Stefan Koch
@UplinkCoder
Feb 01 2015 12:33 UTC
thanks agian
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:33 UTC
I should really add that
Stefan Koch
@UplinkCoder
Feb 01 2015 12:34 UTC
the results look okay
suitable for an interactive graph-visualaisation
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:35 UTC
the control point calculation for bezier curves, or a previous library?
Stefan Koch
@UplinkCoder
Feb 01 2015 12:36 UTC
bezier curves
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:36 UTC
ahh
Stefan Koch
@UplinkCoder
Feb 01 2015 12:38 UTC
are you on the #d irc later ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:38 UTC
no I'm not
not to mention after midnight
Stefan Koch
@UplinkCoder
Feb 01 2015 12:39 UTC
?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:39 UTC
I was referring to the later part
Stefan Koch
@UplinkCoder
Feb 01 2015 12:39 UTC
how late is it in your localtime ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:39 UTC
1:40am
Stefan Koch
@UplinkCoder
Feb 01 2015 12:40 UTC
it's 1PM here
so I am wide awake while your are propably half asleep :D
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:40 UTC
oh, I've been half a sleep all day
didn't get much sleep after a till 4am dev fun
Stefan Koch
@UplinkCoder
Feb 01 2015 12:41 UTC
your Duml was a nice thing, too.
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:41 UTC
it was yes, limited a bit too much
Stefan Koch
@UplinkCoder
Feb 01 2015 12:42 UTC
I am working on another D-parser
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:42 UTC
ah
Stefan Koch
@UplinkCoder
Feb 01 2015 12:42 UTC
it should be rather easy to build uml output from that
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:42 UTC
I would love to do compiler dev work, but assembly is just not my thing
Stefan Koch
@UplinkCoder
Feb 01 2015 12:43 UTC
it does not have to.
codegen ist just one last step
there is much more you can do completely without asm
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:43 UTC
you're correct. But it is the difference between me bothering and not
Stefan Koch
@UplinkCoder
Feb 01 2015 12:44 UTC
so if you can't built a complete compiler you aren't even gonna start ?
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:44 UTC
yup
Stefan Koch
@UplinkCoder
Feb 01 2015 12:45 UTC
well writing compiler is an incremental process
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:45 UTC
even a couple of years ago I couldn't write parsers in any form. Now I can
It's just not my time for that sort of thing
Stefan Koch
@UplinkCoder
Feb 01 2015 12:46 UTC
If need special compiler stuff, feel free to ask me :)
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:46 UTC
thanks
actually there is one thing
D-Programming-Language/dmd#3921
can you guess what needs another review?
Stefan Koch
@UplinkCoder
Feb 01 2015 12:51 UTC
hmm Interesting thing you did there
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:51 UTC
It's blocking the next version of Cmsed
since 2.066
Stefan Koch
@UplinkCoder
Feb 01 2015 12:52 UTC
I am not sure traits should work outside of the module
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:52 UTC
this is a known bug that I fixed
and yes it should work
Stefan Koch
@UplinkCoder
Feb 01 2015 12:52 UTC
the code looks okay to me
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:53 UTC
It's just annoying that its been this way for a while. Atleast I'm sick of web development
Stefan Koch
@UplinkCoder
Feb 01 2015 12:54 UTC
you could use an external parser
like libdparse and generate this list explicitly to work around compiler-limitations
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:54 UTC
maybe and not out of question since I've already got livereload
Stefan Koch
@UplinkCoder
Feb 01 2015 12:55 UTC
my AST strucutures are searchable
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:56 UTC
considering I
I've got a book nearly ready for publishing about CTFE it would be a bit ironical
Stefan Koch
@UplinkCoder
Feb 01 2015 12:57 UTC
you can just ask for allSymbols.filter!(symbol -> symbol.identifier.startWiths(""));
ast generation and ast querys work at ctfe, too.
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 12:57 UTC
I see
Stefan Koch
@UplinkCoder
Feb 01 2015 12:57 UTC
though it's very very slow
at CTFE it's nearly unusable
well I've got to get my PatternAnalyser finished :-/
cya
Richard Andrew Cattermole
@rikkimax
Feb 01 2015 13:00 UTC
And i'm adding in the bezier control points to Devisualization.Util's linegraph
cya