« first day (863 days earlier)      last day (4311 days later) » 

03:00
One class was going to have a std::vector<ShaderPass*> and own it.
When this class died, the resource was going to die with it: one owner.
Xeo
Xeo
@ThePhD ShaderPass* myeyes.jpg
Yes, it's horrible.
Xeo
Xeo
Also, damn. The washing machine still hasn't finished. If this continues, I won't be able to use my neighbours dryer to get the stuff dry before he potentially wakes up. :o
I have std::vector<Stencil*> children
The thing is, other classes that derived from ShaderPassCollection don't necessarily destroy the resources on the vector.
03:00
:(
Xeo
Xeo
@ThePhD What do you mean, "not necessarily"?
@Rapptz Ew, shame on you.
Hint: It's the only solution.
Xeo
Xeo
Fffff.... while worrying about my washing machine, @Andy stole another answer from me. :(
@Xeo I mean that ShaderTechnique is essentially a ShaderPassCollection for ShaderPasses that belong to that technique. But it doesn't own the resources. Shader, however, will own its resources (and is derived from ShaderPassCollection).
Xeo
Xeo
03:03
@ThePhD Oh gawd...
@Rapptz Do tell me why.
Should I just do a shared_ptr?
Because I needed a way of doing parent and children relationship for GUI objects. Do you have a better solution?
All the GUI objects derive from the same object, Stencil.
Xeo
Xeo
@Rapptz Shouldn't a parent own their child?
@Xeo In many cases, not really.
For example, I have two windows. I 'attach' one window to anoter, so that the second window moves when the first one does.
Not necessarily. Parent!=owner, usually.
03:05
Technically, that's just a Stencil* kind of relationship. No ownership, just attachmetnt.
Xeo
Xeo
Aha. unique_ptr<Stencil, std::function<void(Stencil*)>>, where the passed deleter may or may not actually kill the object~
Unless something else actually owns all the children.
In that case, a vector<T*> is fine.
There's.. no owner.
Xeo
Xeo
wat.
Technically.
Racking up the technical debt already.
03:07
It's just attachment
Xeo
Xeo
Okay, lemme reformulate: Who kills the Stencil-derived objects?
@Xeo See, actually, thats' what I was gonna do...
Usually, the app owns all the objects, eventually. The app would have a vector of top-level windows that it owns.
Xeo
Xeo
If you don't like the type-erasure overhead, make it a simple struct killer{ bool _doit = false; void operator()(T* p){ if(_doit) delete p; } }; and pass either killer{true} or killer{false}.
@MartinJames You said it - top-level. This implies, to me, that not all the children a GUI element has are actually owned by somebody else.
@Xeo That was my idea!!!
See see see look:
class ShaderPassCollection : GraphicsResource  {
	protected:
		Dictionary<String, ulword> passindices;
		std::vector<ubiquitous_ptr<ShaderPass, OptionalDelete>> passes;
Xeo
Xeo
03:14
Good boy. pat pat
You'd pass in the ownership semantic with the constructor.
Though, I think I'm going to make it you pass in the ownership semantic when you do the Add instead.
Xeo
Xeo
Although in my killer the default should maybe be true.
Always Kill~
03:15
-1
Q: How use asm to do face recognize?

jackI used ASM to find feature points in the face. Now i can get 68 feature points.But i don't konw how should i use the feature points to recognize different face. This is the picture:

^^ oh gawd...
"How do you build a space shuttle with sticks and stones?"
I daren't open that! I might be in for a rage-quit :)
Well, he gets props for making it that far.
@Mysticial Technically, he already has the thrusters?
Just, uh.
No space ship.
Xeo
Xeo
@Mysticial Wow. Just wow.
Also, as Robot put it, I shouldn't laugh so loud at 4 in the morning.
On th Windows GUI's I've used, ownership is usually passed in ctor, parent by add().
Well, really, in my case, the ownership is a by-shader basis.
My one use case is when I blend two Shader Passes to create a completely new shader at run-time: the Collection doesn't own the resources, so that defaults to 'No'.
The other use case is where a derived class (like Shader) creates one. Then it should default to yes.
Xeo
Xeo
03:19
@ThePhD Erm, if you create a new one, who owns that new shader?
@Xeo I mean it was created outside by somebody else.
Meh - I opened it anyway. Inevitable close-vote.
Xeo
Xeo
Ah
Asking how to do face recognition in assembly is like asking how to build a space shuttle with stone-age technology. There's no way anybody will be able to provide an answer that fits into a hundred textbooks - let alone an SO answer. — Mysticial 50 secs ago
Like, I manually did ShaderPass pass("Vertex.hlsl", "Pixel.hlsl"); and then did MyMixyMixyMatchShaders.Add( pass );
^ My C# was showing for a moment. ._.
In that case, I wouldn't want it to own resources: the scope or the person who created it should be responsible for deleting it too.
03:21
'How can I use SQL to shift EAX right through carry?'
Oof.
You guys have have erroneously closed that question.
guess so
Still, it would've helped if the OP was a bit more clear.
synonyms are evil.
asm => assembly
Like, say, posting a link to whatever the fuck ASM is.
I'll give him an upboat to counteract the downvotes so he can make some links and clean up his question.
03:26
he's pretty much fucked over anyway
Vote to reopen it?
Active Shape Model doesn't even have a tag.
@Mysticial I made one.
hope that isn't illegal..
yeah, I just saw it
it has a wiki article so I guess it's legit.
Xeo
Xeo
03:28
@ThePhD Nah, it's too broad anyways.
it's fine
Sounds like pole-dancing again.
If the question dies, the tag will die with it.
well I voted to reopen.
Xeo
Xeo
Why?
03:28
misunderstanding :|
I feel bad
Xeo
Xeo
As I said, the question is too broad anyways.
IMO
I voted reopen as well. Give the OP a chance.
I'm trying to improve the parent/child thing
but I don't feel like making a deleter
Xeo
Xeo
Also, why the fuck can't I do right clicks anymore :s
03:29
I don't know the topic. So I can't judge whether it's broad or not.
@Rapptz Parent/Child relationships should never indicate ownership ever.
yeah see that was my logic too
but Xeo's all like unique_ptrs
Wots going on? Everyone is agreeing!
Well, he has a point, but in your case it's just not what's necessary.
@MartinJames Yeah we're agreeing on not agreeing on anything.
03:31
THOUGH, I will say: if the owner deletes that Stencil*, you're super fucked.
Xeo
Xeo
23 mins ago, by Xeo
Okay, lemme reformulate: Who kills the Stencil-derived objects?
So you're going to need an Event or Callback of some kind that says "Hey, I'm being Disposed / Destroyed!" and remove it from the parent/child list when that happens.
No one kills anything, it's just reference semantics but with pointers. It's there for the life-time. The most I have is a clearChildren() method that disposes of all the children.
Which made me think that maybe I should rewrite it a bit
Yes - destroying an object implies removing it from its owner and parent, (if it has them).
Xeo
Xeo
@Rapptz So you just do a stuff.add_child(new Something()) or what?
03:33
... no. lol
Haha
That'd be pretty suicidal.
    template<typename Control>
    void addControl(Control& control) {
        static_assert(!std::is_base_of<Control,Stencil>::value, "Controls must inherit from Stencil.");
        this->children.push_back(&control);
    }
Xeo
Xeo
Then there has to be somebody that kills the objects.
Well, he takes a reference, so that alone will make people naturally declare and instantiate the object.
Xeo
Xeo
@Rapptz Why the template? Stencil& control
03:34
because I didn't know you can do that
Xeo
Xeo
Now you do. :)
References can be downcast like Pointers can.
Albeit syntatically I'm worried for myself. ._.
Xeo
Xeo
@ThePhD upcast
Anyway like I said, it's just reference semantics. There isn't too fancy about it, no ownership involved, and really no killing.
Everything in the engine that renders primitives using a Shader or collection of shader passes will take void RenderWith( ShaderPassCollection& ).
This means I'll be able to provide Shader, ShaderTechnique, but it's a little.... verbose. =[
I wonder if I should make ShaderPass a ShaderPassCollection itself.
That just has a count of 1 and returns itself...
Xeo
Xeo
03:36
@Rapptz With killing, I also mean as part of a greater object, say struct X{ Something control; };.
I just want to know how the Stencil-derived object will eventually die.
@CatPlusPlus Hey, uh. I'm gonna need help. x_x
I still don't know how I'm going to go about rendering text.
Xeo
Xeo
@ThePhD Singleton list, huh
(Not the bad kind of singleton.)
I know for a fact, though, that I will rather break my legs than use DirectWrite, after hearing Melak's struggles with it.
That and because DirectWrite uses BGRA. ._.
I mean, seriously?
Xeo
Xeo
Gawd, my 8KB down feel slower than before.
Lol
When are you gonna get that new internet?
03:40
I'll be back later.
Xeo
Xeo
So much for your efforts, OP deleted the question. :) /cc @Mysticial @Rapptz @ThePhD
lol ThePhD can't vote to reopen
Xeo
Xeo
Just when I wanted to vote to reopen.
aww...
he made a dupe question
-2
Q: How to use asm to do face recognize?

jackI used ASM to find feature points in the face. Now i can get 68 feature points.But i don't know how should i use the feature points to recognize different face. can anybody give me some help? Thanks for you help! OK, i use asm tag,but the system will change it to assembly. I don't know why. This ...

Xeo
Xeo
03:40
In fact, my reopen vote got through.
@ThePhD Pango? vOv
@CatPlusPlus Okay. Uh. Do you know how to interoperate that with D3D?
What does it entail with dependencies and such?
@Xeo Usually by a recursive 'close' call originating from a top-level window that has a 'Close' icon.
Xeo
Xeo
grah, @Rapptz is evading my questions. :|
@MartinJames Yeah, the close button calls on clearChildren
03:42
@Xeo The OP can't delete a closed question unless it's been closed for 2 days.
Xeo
Xeo
@Mysticial Interesting
@Xeo because I don't know how to answer them
these are things I was thinking about earlier but never got around implementing
@Rapptz But I can upvote to save his rep.
"I used ASM to find feature points in the face" Sounds like he did a lot of work :-)
I only started the parent/child thing today
Xeo
Xeo
03:43
@Rapptz All I want to know is how the C++ object that represents the control is going to be destroyed. :(
@Rapptz Did you just become a parent or something? :P
@Xeo Naturally, from main's stack?
@Xeo At the moment.. when scope exits.
Xeo
Xeo
Maybe I just shouldn't bother.
@ThePhD Dunno
Direct2D will probably be more straightforward
03:44
Direct2D doesn't play nice with Direct3D 11 :c
Or Direct3D in general.
Xeo
Xeo
@Rapptz So the owner is the function that adds the control (or an upper-level function that calls this function). Thanks, that's all I wanted to know from the beginning. :)
@Xeo Usually when its owner is destroyed and so destroys its owned objects.
There's always GDI
@CatPlusPlus Maybe we could use freetype and serialize our text on the fly?
FreeType is for rendering glyphs and just that
Xeo
Xeo
03:46
@MartinJames And I wanted to know who that owner was.
Oh. Just for rendering...
We can't, like, get outlines and shapes?
You need more to render text
Pango does layouting and shaping and stuff
Xeo
Xeo
In any case, I think my RMB died a sudden and silent death.
@Xeo RMB?
@Xeo Either the app(top-level window), another window, (most other objects), or maybe nothing?.
03:47
RMB?
Xeo
Xeo
Right mouse button.
"And the mouse clicked its last, and commited its spirit unto the Motherboard."
Pizza crumbs under button
Xeo
Xeo
@MartinJames If nothing owns a control, you have a resource leak. gg.
the Window owns all controls and when it gets closed it does its clean up :|
03:48
@Xeo Yes, so best to avoid nil owner.
Does it REALLY?!
yeah I guess so if we're going by that definition
Xeo
Xeo
@ThePhD The mouse itself still works. :(
@CatPlusPlus Really all I want is something I can take and turn into Vertices. After that, we've pretty much got what we need out of it.
If we can turn it into vertices, we don't have to worry about bitmap fonts or sizing issues because we can just vomit the vertices onto the graphics card.
Xeo
Xeo
@MartinJames It's not "best to avoid", it's "this shit can't possibly happen without you doing something wrong".
@ThePhD I think the font and sizing issues are before you get the vertices out of a letter. :P
03:51
@Xeo Well, you may say so. Be very careful about adding any sort of constraint when doing top-level designs.
@Xeo Well if we pull out the vertices for a fancy V at size 100, we'll pretty much have all the data we need to render the font at any resolution on screen.
Xeo
Xeo
@ThePhD Vector fonts, yay!
Then it's just a matter of doing instancing for each letter across the screen.
@Xeo Yeah, Vector fonts! That's the idea anyhow.
Xeo
Xeo
@MartinJames Resource leaks are a programming error, in all cases. And a control not having an owner is a resource leak. Also, what are "top-level designs"?
@ThePhD Eh, I don't think anything renders fonts like that
03:53
Hm. So we go to Bitmap fonts, then?
If it's bitmap fonts, I can do it. I can do it hard. I wrote plenty of systems to work with Texture fonts and blit them onto the screen.
An object with no owner is not necessarily a resource leak. If you have a reference to it, it's not leaked.
I wanted to take the vector approach this time though, because... well, it sounded like a good way to go.
I mean it's all Bezier curves, it sounds like something that'd end up being a lot of polygons
Xeo
Xeo
@MartinJames Wat.
Well vertices
03:54
@CatPlusPlus ... Oooh yeah.
... Beziers. ._.
Xeo
Xeo
If that reference is not responsible for destroying the object, it's still a leak.
SO HOW 'BOUT THEM BITMAP FONTS CAT? <3
Xeo
Xeo
And if the reference is responsible, then the object got by definition an owner - the reference.
Bitmap fonts suck, but even I managed to implement this with a simple shader so
I already have a hardcore shader for getting vertices onto the screen fast.
( as quads )
03:55
If you don't need Unicode support then bitmap font should work
Xeo
Xeo
Zalgo~
With Unicode, forget it
@Xeo When I said 'owner', I was referring to an entry in the 'ownedObjects' container of another object.
_W"Meh"
Yeah... while our strings have Unicode support, at the moment I don't think I need to display anything other than FPS and other statistics data on the screen.
03:56
I've read distance maps can be used to render TrueType fonts but fuck if I know what's that and how to implement it vOv
Xeo
Xeo
@MartinJames That's an incomplete definition of "owner", and also not what I was talking about.
Distance... maps?
Xeo
Xeo
@Mysticial lol
Does anybody know to make Visual Studios use ASCII?
03:57
Or just render text into textures and texture simple quads with whole blocks of already rendered text
Or just draw over the viewport I don't know
I've never had patience to actually do font rendering
@CatPlusPlus Distance mapping blah blah blah stuff: bitsquid.blogspot.com/2010/04/…
@Xeo For GUI purposes, what do you suggest we use instead of 'owner' for an entry in the 'ownedObjects' container of another object?
Xeo
Xeo
@Mysticial lol @ the unicode one
I'm subscribing to that subreddit.
..anyway, I have to get some sleep now. I'm all GUI'd out...
03:59
night
Niiiight.

« first day (863 days earlier)      last day (4311 days later) »