« first day (220 days earlier)      last day (4719 days later) » 

10:02 PM
You can get VERY lost in 3d rendering.
Especially if you rely on a visual understanding, which I do.
Hurts me big time in complicated math.
 
@Tony: I don't mind if you have a good learn from it, but kindly don't rip it off
since it is the product of many, many hours
although, admittedly, the main benefit is the understandings I've gained, not the code itself
 
@DeadMG oh I won't use it for anything, I may merely learn from and try some things to learn, no more, nothing will ever leave my machine.
 
You have something good enough to worry about it being copied?
 
not really, it's more of a personal thing
I'm very possessive over things I view as mine
and that source code is very undoubtedly mine
 
Yeah, it renders everything wrong. Don't think anyone else would claim it ;)
 
10:05 PM
lol
 
@Xaade if he doesn't want it copied, I shall respect that and not copy it, doesn't matter if it was worth it or whatever...
 
hey, it renders text just fine, I will have you know
 
and sprites
 
@TonyTheTiger It wasn't a judgement, it was an inquiry. I was curious to know if it was superawesome. If so, I'd want a look too.
 
10:06 PM
the trouble is, it renders textures, not textured quads
but apart from that, they're rendered perfectly correctly too
 
The best advice I can give when it comes to 3d is MANY MANY MANY layers of abstraction.
 
just one will do me
 
Get to the point where all you're coding is, move object to x,y,z and object moves in path over time or something....
with animations
 
lol
well, one of the things I like most about it is that it's all smart-pointer managed
so if I wanted to, I could change the allocation schemes from just new/delete to a custom allocator
 
Yeah, it takes the coding work out of the code. All you're left with is the math and visuals.... which is hard enough as is.
 
10:08 PM
which is one of the things I have on the "optimizations" pile
uh, smart pointer managed, and the allocations are completely encapsulated
and also I like how you don't have to manually call Render() on anything
 
now if only I could find AI that wasn't so tightly coupled to the engine's implementation.
 
easiest thing to do there is just to ensure that your engine's implementation is sufficiently abstracted
oh @Tony: Check out the pointer repositories in the D3D9Render class
 
Yeah, that's what I meant about earlier..... MANY levels of abstraction.
 
that typeid() call makes my life special :p
took me a while to work out how I would create a vector of pointers to any T for which those member functions were called
without taking excessive time
like O(n) dynamic_casts
 
I like O(n)
 
10:12 PM
well, I got it down to O(log(n)) or O(1), depending on if I used std::map or std::unordered_map
 
Long as it's not O(n^x)
 
what on earth is x?
 
O(2^n)
 
you know
all this talk of how sexy my code is has made me want to resume work on it
 
Really....
Code doesn't really warm up the bed at night.
 
10:13 PM
well, I just finished my coursework
lol
 
@DeadMG what do you mean pointer repository?
 
well
I got sick of manually making std::vector for every type, the pointers of which I wanted to monitor
so I made a repository which could accept and then feed back on every type of T
also, don't ask me why it's in namespace Wide
it just is
 
woot.... variadic typed vector
 
nah, I ended up with std::set<std::string, std::vector<void*>>, and then used typeid() to pull back the vector of pointers appropriately
 
@DeadMG I was gonna ask you, but I guess now I don't need to anymore
 
10:16 PM
but I also specialized the function to return a cached std::vector<T*> for specific pointers which I need to optimize access to
 
@DeadMG and thats in that D3DRender class?
 
yeah
 
God class!!!
 
why?
it encapsulates the state of the renderer
oh man, reading this, I have like, six billion functions implemented inline in the header unnecessarily
 
10:18 PM
and they're defined in a completely random order
 
yea a lot of inline...
 
well
I kept changing the return types
and couldn't be bothered to keep changing the implementation file separately
 
oh
I like how you have unique_ptr for your COM Interfaces... smart
 
oh yes
you can do the same with shared_ptr, but I don't actually need reference counting, all my COM interface uses have just one reference
 
but the COM object keeps track of it's own references, so how does that work inside a unique_ptr?
cause a unique can only have one, AFAIK
 
10:20 PM
the unique ptr decrements the reference count
consider it unique within my code
 
so there's only one Interface pointer within your code per object?
 
yes
 
Our heavenly God class,
hallowed by thy all encompassing namespace,
let you encapsulate all
Let your will be all, as it is in declaration and implementation.
Give us this process, our every need
And forgive us for wanting to decouple you
As we forgive those who want more interfaces
And lead us not into polymorphism
But deliver us from inheritance.
Compile.
 
because of the unique_ptr
 
I have no situations where I have multiple handles to the same object
and, indeed, if I did, then I could use shared_ptr for that circumstance
 
10:21 PM
@Xaade epic :)
 
lol
 
hmm interesing
learning all the time
:)
 
although the hilarity of shared_ptr
I would be reference counting a reference
 
@DeadMG huh?
because the interface pointer is already ref counted?
 
yeah
but shared_ptr keeps it's own refcount
which as far as I know is not overridable behaviour
 
10:24 PM
but you do have some raw pointers too.... is there a reason for that? like on D3D9Camera for example
 
@Xaade I love the "compile" where "amen" goes.
 
I don't see any raw pointers there
oh, you mean the raw pointer to the D3D9Camera?
 
@DeadMG yea that is what I mean...
 
that's because the D3D9Camera instances are managed by the application
 
@MartinhoFernandes that part took me a second, then the answer was obvious....
 
10:25 PM
in their destructor/constructor, the raw pointer is explicitly managed if necessary
the raw pointer doesn't own anything, that's why it's a raw pointer
it's just there to indicate which camera is in use currently
 
It doesn't take me long to do short satire like that.
 
@DeadMG oh ok
 
same with the D3D9Button*.
of course, in a real UI element hierarchy, I'd have a UIElement*
but since the only element that supports anything, at all, except being rendered is the Button
then a D3D9Button* does fine
 
I like how you have stuff as a variable name is some places... haha
 
lol
which method has that?
 
10:27 PM
an unordered_map is called that
in your D3DRender class
 
    std::unordered_map<std::string, std::unordered_set<D3D9Common*>> stuff;
heh
 
YES... awesome.
 
wasn't sure if I should post it here
 
stuff.getlength();
 
10:28 PM
you'd have to post a lot of code to enable anyone else to seriously benefit
so I don't care about snippets and stuff
yeah
 
oh... and stuff eh
 
stuff.head()
 
lol
that variable is the pointer repository
as you can see in the functions defined right below it, it's used to hold pointers to arbitrary extra types that I want to monitor but don't care about the performance of
 
Could only be better if named sh*t
I guess one could make a message named that....
eat sh....
 
@Xaade that would be a pointer to a sh object named t
sh * t = new sh();
 
10:30 PM
sh | t
 
or a multiplication of sh and t
 
Hell yeah, my MIPS assembly implementation of sparse vectors work, I'm so awesome.
 
@CatPlusPlus I guess... not sure what you've done, but yea
 
hmmm.... I think my next goal is to make a program and rename everything so it curses at the reader....
 
oh fucksickles
I left in all those crappy, annoying typedefs when I could have used the miracle of decltype
 
10:32 PM
@DeadMG the miracle of decltype is still over my head
 
it gives you back the type of whatever expression you put into it
decltype(GetPtrs<D3D9Button>()) buttons = GetPtrs<D3D9Button>();
creates an object named buttons, which is the type of the return type of GetPtrs<D3D9Button>()
to be precise
had to use that instead of auto to preserve reference semantics
 
oh wow
 
Like a vat of acid, you throw in expression and everything melts, except for the type.
 
Message Deleted
 
and so what's the reason for doing it like that instead of just creating a variable of the right type?
 
10:34 PM
because some of them return references and some of them return values
and I reserve the right to change it at any time
 
@DeadMG auto&& ?
 
oh I see
seems like black magic to me
 
@Luc Danton: Pretty sure this was written before I properly understood reference semantics
but I don't think that will work
 
What???
 
@Xaade we can still view the history
lol
 
10:35 PM
what if the function returns T&? auto becomes T and auto&& becomes T&&, which is not happy binding to a T&
@Tony: It is black magic- but I didn't have to implement it, the poor sods at Microsoft did
 
Geez....
 
@DeadMG yea, cause a T& is an lvalue
@DeadMG lol
 
This user has been banned
 
and T&& can only reference an rvalue
 
well, it's really not black magic at all, it's completely the same magic as is used to find type errors and stuff, I just can ask it to be my bitch instead of only doing what it's pre-programmed to do
 
10:36 PM
@DeadMG Same rules as in template deduction: T& && collapses to T&
 
Room topic changed to Lounge<C++>: Where Xaade is not invited
 
@Luc: Except it's not T& &&, it's just T&&
 
@LucDanton Ampersand overflow?
 
because auto is a value type
 
Think of it as template<typeame T> T&& val = expr;
 
10:36 PM
@Xaade you post way to much random crap :P
 
no, that doesn't work at all
 
i.e. templated variables
 
because auto x = expr() != decltype(expr()) x = expr();
 
(and auto is not a type)
Well yes
 
that is, auto decays all references and constness to produce a value type
 
10:37 PM
auto follows deduction rules
Yes like T in a template
and auto&& behaves like T&&
 
if you return T&, auto becomes T, and auto&& becomes T&&
 
i.e. perfect forwarding
 
Huh.... I thought auto referred to scope
 
no, in perfect forwarding, the T doesn't decay
that's how perfect forwarding works- because T doesn't decay
 
perfect forwarding prevents T decay.
 
10:38 PM
@Xaade Not anymore. Now it's automatic type deduction.
 
@DeadMG And the rules that make this happen apply to auto
i.e. reference collapsing
 
That's the point.
 
Did anyone even used the old auto?
 
what does auto T; do?
 
@CatPlusPlus: No, that's why they re-purposed it
 
10:39 PM
@CatPlusPlus not very often per Herb Sutter
 
@Xaade C++03 or C++0x?
 
@Xaade nothing, no type to be inferred. in C++0x
 
an error for both still
 
I always viewed it as useless, and never seen it in any code.
 
apparently, long ago in C, it was required to be explicit
 
10:40 PM
oh.... I thought when you said value type, you meant primitive value type.... you mean value as in not reference.
 
before someone realized that that was fucking stupid, not to put too fine a point to it
it's my understanding that's the history
 
auto meant default scope.
which was default scope.
 
ok, off to bed, I have to get up early tomo
nite
 
Like doing class A { private: int B; };
pointless
 
in my opinion, the default should have been public
every class needs public members, realistically, but no class has just private members
 
10:42 PM
What's the point in using class if struct is the same thing but with public default?
 
@DeadMG Write structs.
 
nah, I like to write class because I find that it turns me on, whereas struct makes me feel filthy
 
Structs FTW!
 
I always associate it with those crappy typedef struct x { int y; } x; abominations from C
 
gah.... random crashing is not fun.
 
10:44 PM
harhar
 
Yeah, well @DeadMG, guess what.... that's what I use a lot of, because a lot of our data is transferred as C primitives.
 
Never found out why it needs a tag if you never refer to the tag?
We always use the alias
 
@Xaade It doesn't need it unless you refer to it.
 
oh jesus, my guts hurt
 
10:45 PM
typedef struct node { int y; struct node* next } node;
 
Hmm.... my workplace has weird standards.
 
You can't use the alias inside the struct. It's not defined yet.
 
What do you use?
the tag?
 
why oh why did I have to eat that ice-cream
 
what's the difference?
 
10:47 PM
@Xaade To use the tag you need to prefix it with the struct keyword (in C).
 
I see.
So the alias works on its own, but the tag needs struct.
Odd requirements
 
It's C. 'nough said.
 
you don't need to do.... class CA cA;
 
In C++, no.
 
that's because class didn't exist in C, so they wouldn't break anything changing it
 
10:48 PM
@Xaade In C++, you don't need it even for structs.
 
What about C++, do you need the struct keyword?
 
no, it's unnecessary, but you can
 
In C structs are in their own namespace.
 
and you can do it for classes and unions too
 
WHAT THE HELL??????????
WHY do I have the weirdest coding standards anywhere.
 
10:49 PM
what's wrong?
 
I'm required to put a tag in there....
here... let me show you.
 
in comparison to the printing on paper, that's way less dumb
 
class X {} x; defines a variable in C++, that's why everything borks out when you forget that damn semicolon at the end.
 
typedef struct tagSTRUCT { something; } STRUCT_s, *LPSTRUCT_s;
 
(Which I personally find stoopid.)
 
10:50 PM
that's how I have to make structures.
 
@CatPlusPlus I was they'd forsaken that syntax and we would be free of the damn semicolon.
 
yeah
 
but why when you don't need alias and you don't need struct keyword.
 
_s? I thought usual convention in C is using _t.
 
it is
 
10:51 PM
Are you doing C or C++?
 
Yeah, I always forget that for declarations of class and struct union you need ; at end, but nowhere else.
C++ is what I'm writing in.
Which means I don't need alias right.... I can just use the tag.
 
yes
you don't need anything like that at all
 
WTH
Another pointless waste of time.
I understand the *LPNAME_s saves a little time, but still.
 
no, it doesn't
faster to type NAME* than LPNAME
 
well.... yeah
I give up
I quit at trying to reconcile any standards.
This is weird. Why is my CtlColor message being called if there's no hWnd for my window yet?
It's crashing because it doesn't have an hWnd, and GetWindowText wrapper tries to build a string of length -1, when GetWindowText API returns -1 for "error".
Stupid windows code.
 
10:58 PM
want to throw: exceptions
 
It's not my code
 
WTF? ideone.com/GMDeU Why isn't the array initialization working? Do I need to sleep?
 
void CWnd::GetWindowText(CString& rString) const
{
	ASSERT(::IsWindow(m_hWnd));

#ifndef _AFX_NO_OCC_SUPPORT
	if (m_pCtrlSite == NULL)
	{
#endif
		int nLen = ::GetWindowTextLength(m_hWnd);
		::GetWindowText(m_hWnd, rString.GetBufferSetLength(nLen), nLen+1);
		rString.ReleaseBuffer();

#ifndef _AFX_NO_OCC_SUPPORT
	}
	else
	{
		m_pCtrlSite->GetWindowText(rString);
	}
#endif
}
How about:
if (nLen < 0) return;
 
@Martinho: Most likely, the uniform init syntax isn't done yet, so you'd need x({...})
 
In GCC 4.6 x({1,2,3,4,5}) does not work, but x{{1,2,3,4,5}} does. I don't get it.
 
11:09 PM
uniform init before initializer list?
 
I don't understand. Wouldn't that initialize the first element with an initializer list?
Or is it some weird syntax I didn't knew/notice/realize?
 
it's uniform initialization with an initializer list
 
But why would the regular initialization with an initializer list x(...) fail to compile?
 
no idea
 
Guess GCC does not have initializer lists in full yet :(
 

« first day (220 days earlier)      last day (4719 days later) »