you usually need a temp vector, such as one of the primary axiis to do this. so say you are x+ right, y+ up, z+ forward. take your lookatpoint and subtract position. cross(world.up, forward)with WORLD up(not local) to get right, then cross(forward, right) to get a true up vector.
Read through the comment block in the first pass, and then the second. He is gathering directed edges where the i1 comes before i2. This is a shortcut for the second pass, notice the differences between the 2 loops.
Sorry I was not clear before, I meant to ask which axes would I project my shapes edge on the X and Y axes or on an arbitrary axes that is made up by myself.
I think Aardvajk covered that pretty well. For 2 objects in 2D, you will need to project against each face normal of each object, with the exception of normals that are colinear with another normal. For a Triangle, you would have 3 axii, each perpendicular to one of the triangle's edges. For a square, you have 2 axii, the local X and Y, as the other 2 normals are -x and -y, which are collinear with their respective inverses.
One option would be to setup a stencil op such as ZERO, or REPLACE , in combination with your write mask, and render a full screen quad, so that each pixel of the stencil buffer is written to what you want. This would add some Draw calls, but would get the functionality that you want.
Important to note when using Burnt_Fyr solution, it you probably want to go to the drop down box at the top and set the configuration to All Release, otherwise it could fail when you build the release version. You don't have to do this, but it makes it easier as you don't have to manually add the libraries to all the configurations.
I didn't advise this, as OP may have different dependencies for debug and release. My own code is broken into several libraries, and each has a separate debug/release config, so when I'm including that library in a debug configuration, I want the debug config of that library, which may have sanity checks or evil helper functions for quick and dirty testing, that I shouldn't rely on in release versions. When I'm compiling a release, I use the stripped down release versions of my libraries.
Ok, who's the idiot who keep downvoting me and don't have the balls to tell why??? The information i provided is 100% accurate and lots of people do it that way i dont see why i should get downvoted for this. Last week i got downvoted for a post i posted in march... cmon.
I feel your pain, it seems silly to be punished for a valid answer. #pragma comment may be VS specific, but so was my answer.
Just getting into OpenGL 3+ has become a daunting task, trying to implement a highly versatile rendering system capable of everything I can't forsee.
Analysis paralysis hits everyone eventually. If you can't forsee the need, don't worry about accounting for it. Worry about what needs to be done, or as ApochPIQ said, focus on the actual requirements of the project. If at a later date you need something done differently, make a note in your code, and return to it in a later revision.
You will need to setup the library directory (project->properties->configuration properties->vc++ directories) if glaux is not in a directory already accessible by the project, as well as the add the library as an additional dependency (project->properties->configuration properties->linker->input) If you are compiling glaux, you can add that project to the existing solution, and use project->properties->common properties->add new reference instead.
If you are including files such as headers, you may need to setup those as well, either as an include from vc++ directories, or through c/c++->general->additional include directories.
the above applies to vs2010, but should work in 2013 unless everything has been changed again.
I suspect that the creation of the surface will fail with that flag active though. Try it by all means but last I recall resources meant for shader binding don't play nice with GDI+.
I would assume that DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE would actually force the backbuffer(and others if not double buffering) to be created with the D3D10_RESOURCE_MISC_GDI_COMPATIBLE in the buffer description, internally.
@BuckEye: glad you found the bug, how did you come by it? That section wasn't part of the original code you posted, did the GDI text work before resizing the window/buffer or was this something that was called before you had actually presented the first frame?
I think Jason's solution should work, ie; present your back buffer, and draw GDI on top afterwards, although to be honest I feel like I'm and ant among giants in this thread. Have you tried rendering to your MSAA-able surface, and then biltting (if possible) or using that as a texture to draw a full screen quad on to a GDI compatible surface?
I tend to do what others have suggested and just use separate HWNDs and swapchains for child areas of the hwndmain client.