<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>directxtk Discussions Rss Feed</title><link>https://directxtk.codeplex.com/discussions</link><description>directxtk Discussions Rss Description</description><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
that's it. Works all fine now. Thanks!&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Fri, 17 May 2013 06:12:07 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130517061207A</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;I imagine that's because the interop hasn't completed initializing yet. Put it in CubeRenderer::CreateWindowSizeDependentResources() instead, or somewhere else.&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Thu, 16 May 2013 20:26:55 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130516082655P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I don't get an StackTrace. The Problem i think is here the mixed C++ and C# Code. The WP8 Project is written in C# and includes the C++ Library. I only get the ArgumentViolationException. I also do not think the m_d3dContext is bad, because if I remove the SpriteBatch initialization, all other code (including Context Methods) work fine.&lt;br /&gt;
&lt;br /&gt;
I use the Standard Default Template of Visual Studio and only added the DirectX Tool Kit.&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Wed, 15 May 2013 18:03:50 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515060350P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Usually I've found this will happen when you've got a bad pointer (perhaps you deleted it somewhere or it was never initialized?). I'd need more information (a stack trace would be handy here) to help you figure out what the cause was. If it's happening when you create your SpriteBatch object, I'd bet your m_d3dContext pointer is bad.&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Wed, 15 May 2013 17:07:33 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515050733P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
if I try to create a new SpriteBatch, I get an AccessViolationException on (MainPage.xaml)&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dBackground.CreateContentProvider());&lt;/code&gt;&lt;/pre&gt;

Code to init SpriteBatch (CubeRenderer.cpp in CreateDeviceResources()):&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;m_spriteBatch = unique_ptr&amp;lt;SpriteBatch&amp;gt;(new SpriteBatch(m_d3dContext.Get()));&lt;/code&gt;&lt;/pre&gt;

As Project Template I use the default Windows Phone Direct3D with XAML Tempalte of the Windows Phone 8 SDK and I modify the CubeRenderer basic class. Does anyone know this issue?&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Wed, 15 May 2013 08:42:54 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515084254A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;That article was perfect! It really helped me understand what was actually going on and how to draw my billboards correctly. My rendering looks great now and is batched together.&lt;br /&gt;
&lt;br /&gt;
Thanks again Shawn! Also, it seems like your blog has a wealth of free information. I'll be studying up on it a lot in the future :)&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Wed, 15 May 2013 05:55:35 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130515055535A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;This article might help with your question about depth sorting:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/shawnhar/archive/2009/02/18/depth-sorting-alpha-blended-objects.aspx" rel="nofollow"&gt;http://blogs.msdn.com/b/shawnhar/archive/2009/02/18/depth-sorting-alpha-blended-objects.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Wed, 15 May 2013 03:22:40 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130515032240A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;Thanks Shawn, this is very helpful. I'll take your advice and do a XMVector3Transform() to transform my positions on the CPU using the billboard's world matrix before rendering, keeping each billboard using the same state for the batch.&lt;br /&gt;
&lt;br /&gt;
The 2nd concern I had was the ordering of the billboards when they were drawn. Giving each billboard its own separate batch had them clipping each other. Do I have to sort manually via Z order before drawing or is there a way to have PrimitiveBatch do the right thing?&lt;br /&gt;
&lt;br /&gt;
Thanks again for your help!&lt;br /&gt;
&lt;br /&gt;
Jared&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Tue, 14 May 2013 20:14:53 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514081453P</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;You cannot change state settings in between individual draw calls within a single batch.  The whole point of a batch is to 'batch' up many draw calls, then submit them to the GPU all in one go.  So by definition, it's impossible to have a different state for each draw, because there is really only one single combined draw taking place.&lt;br /&gt;
&lt;br /&gt;
The simplest solution is to use a separate batch (begin/end block) for each object that you want to draw using a different state.  First set the state, then begin the batch, then draw, then end the batch.&lt;br /&gt;
&lt;br /&gt;
A more efficient approach is to draw everything in a single batch, and change your rendering algorithms so that all the objects within the batch can use the same state.  This means no longer applying a different world matrix to the effect per draw.  One way to do that would be to leave the effect world matrix set to identity, and instead apply that same transform to your source vertex positions on the CPU, before passing them to PrimitiveBatch.&lt;br /&gt;
&lt;br /&gt;
An even more efficient but complex way to draw very large numbers of billboards is to do the billboarding computation inside the vertex shader.  I don't know of a good D3D sample showing this technique, but the XNA Particle 3D sample uses this idea.&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Tue, 14 May 2013 19:48:26 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514074826P</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;I've been struggling a bit to get this working the right way.. figured I'd give this forum a try.&lt;br /&gt;
&lt;br /&gt;
I'd like to batch a textured billboard quad draw using BasicEffect and PrimitiveBatch.. but I'm not sure how to go about doing this. &lt;br /&gt;
&lt;br /&gt;
What I'm trying to do looks something like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// Setup during initialization
BasicEffect* be = new BasicEffect(dc);
be-&amp;gt;SetTextureEnabled(true);
be-&amp;gt;EnableDefaultLighting(true);

// Load shader blob using BasicEffect and Create input layout using
// VertexPositionNormalColorTexture in DirectXTK
// Create PrimitiveBatch&amp;lt;VertexPositionNormalColorTexture&amp;gt; 

// Every Update Call 
be-&amp;gt;SetProjection(camera-&amp;gt;GetProjection);
be-&amp;gt;SetView(camera-&amp;gt;GetView);

// Every draw call
be-&amp;gt;SetTexture(myTexture);
be-&amp;gt;Apply(dc);
dc-&amp;gt;IASetInputLayout(myLayout);
primitiveBatch-&amp;gt;Begin();

for(auto it = billboards.begin(); it != billboards.end(); it++)
{
    be-&amp;gt;SetWorld(it-&amp;gt;GetWorld());
    be-&amp;gt;Apply(dc);
    primitiveBatch-&amp;gt;DrawQuad(/* draw quad vertices untransformed */);
}

primitiveBatch-&amp;gt;End();
&lt;/code&gt;&lt;/pre&gt;

In case it's not clear from my code, I'm trying to save to the perframe const buffer the final world translation of each billboard in the effect before calling primitiveBatch draw. The only way I can get this to work properly is do a PrimitiveBatch::Begin() and ::End() call per billboard with each having the basic effect's world translation set each time before the call to ::Begin(). &lt;br /&gt;
&lt;br /&gt;
Also, even with my non-batch like calls to PrimitiveBatch, my billboards do not draw in the correct order... Although they do show up as transparent, when placed next to each other, they seem to clip each other. Do I have to manually order each one before drawing in the batch based on its z value?&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;br /&gt;
Jared&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Tue, 14 May 2013 17:35:31 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514053531P</guid></item><item><title>New Post: Where to start</title><link>https://directxtk.codeplex.com/discussions/443363</link><description>&lt;div style="line-height: normal;"&gt;There's a ton of material on MSDN for &lt;a href="http://dev.windows.com/" rel="nofollow"&gt;Windows Store&lt;/a&gt; and &lt;a href="http://dev.windowsphone.com/" rel="nofollow"&gt;Windows phone 8&lt;/a&gt; which is your best place to start for overviews...&lt;br /&gt;
&lt;br /&gt;
As for DirectXTK, there are a few basic samples to get you &lt;a href="https://directxtk.codeplex.com/wikipage?title=Samples&amp;amp;referringTitle=Documentation" rel="nofollow"&gt;started&lt;/a&gt;:&lt;br /&gt;
&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 14 May 2013 06:55:56 GMT</pubDate><guid isPermaLink="false">New Post: Where to start 20130514065556A</guid></item><item><title>New Post: Where to start</title><link>http://directxtk.codeplex.com/discussions/443363</link><description>&lt;div style="line-height: normal;"&gt;I'm a total beginner and I'm wondering if there is any good and free tutorials that go into detail to help me get started making games foe windows store and windows phone 8.&lt;br /&gt;
&lt;/div&gt;</description><author>Strikerx87</author><pubDate>Sat, 11 May 2013 22:53:23 GMT</pubDate><guid isPermaLink="false">New Post: Where to start 20130511105323P</guid></item><item><title>New Post: [Request] implement cone as geometry primitive</title><link>http://directxtk.codeplex.com/discussions/441275</link><description>&lt;div style="line-height: normal;"&gt;This discussion has been copied to a work item. Click &lt;a href="https://directxtk.codeplex.com/workitem/921" rel="nofollow"&gt;here&lt;/a&gt; to go to the work item and continue the discussion.&lt;br /&gt;
&lt;/div&gt;</description><author>walbourn</author><pubDate>Wed, 24 Apr 2013 17:32:57 GMT</pubDate><guid isPermaLink="false">New Post: [Request] implement cone as geometry primitive 20130424053257P</guid></item><item><title>New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center</title><link>http://directxtk.codeplex.com/discussions/441354</link><description>&lt;div style="line-height: normal;"&gt;Yay!  Glad to hear you figured it out.&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Wed, 24 Apr 2013 14:38:18 GMT</pubDate><guid isPermaLink="false">New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center 20130424023818P</guid></item><item><title>New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center</title><link>http://directxtk.codeplex.com/discussions/441354</link><description>&lt;div style="line-height: normal;"&gt;Hi Shawn,&lt;br /&gt;
&lt;br /&gt;
Please, close this request. Seems I kept overlooking the fact that I was using the scaled width and height as means to set the origin, instead of the actual width and height of the texture itself. I was probably staring at the screen too long. Just went back to take you screenshots and noticed it right away.&lt;br /&gt;
&lt;br /&gt;
Best,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Chev&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ChevonChristie</author><pubDate>Wed, 24 Apr 2013 04:19:56 GMT</pubDate><guid isPermaLink="false">New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center 20130424041956A</guid></item><item><title>New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center</title><link>http://directxtk.codeplex.com/discussions/441354</link><description>&lt;div style="line-height: normal;"&gt;Please show us what code you are using to draw the sprite, and what result you get.&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Tue, 23 Apr 2013 23:03:54 GMT</pubDate><guid isPermaLink="false">New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center 20130423110354P</guid></item><item><title>New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center</title><link>http://directxtk.codeplex.com/discussions/441354</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I have been trying to rotate a sprite about it's own center using the SpriteBatch::Draw method and the correct origin. However, the sprite rotates on about another center point, and drawing sprites rotated a different angles forms a &amp;quot;pinwheel&amp;quot; (&lt;a href="http://0.tqn.com/d/rubberstamping/1/0/E/D/-/-/purple1.jpg" rel="nofollow"&gt;http://0.tqn.com/d/rubberstamping/1/0/E/D/-/-/purple1.jpg&lt;/a&gt;) in which the center of the wheel would be the origin the sprites rotate around, rather than their own, center origin that I calculated using XMFLOAT2 origin(spriteWidth/2.0f, spriteHeight/2.0f)&lt;br /&gt;
&lt;br /&gt;
Can you please provide a quick sample or point me in the right direction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Best,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Chev&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>ChevonChristie</author><pubDate>Tue, 23 Apr 2013 21:05:04 GMT</pubDate><guid isPermaLink="false">New Post: [Request] Sample with Sprite Rotation About Sprite's Own Center 20130423090504P</guid></item><item><title>New Post: [Request] implement cone as geometry primitive</title><link>http://directxtk.codeplex.com/discussions/441275</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I'm sorry if this is not the right place to request, is there a chance to implement a cone as a geometry primitive in DirectxTK?&lt;br /&gt;
&lt;br /&gt;
the reason is, cones are very useful in implementing spot lights, especially in deferred or pre-pass lightning renderers.&lt;br /&gt;
&lt;br /&gt;
thanks in advance.&lt;br /&gt;
&lt;/div&gt;</description><author>sapp</author><pubDate>Tue, 23 Apr 2013 11:29:06 GMT</pubDate><guid isPermaLink="false">New Post: [Request] implement cone as geometry primitive 20130423112906A</guid></item><item><title>New Post: is SpriteFont::DrawString  dependes on render target size</title><link>http://directxtk.codeplex.com/discussions/439643</link><description>&lt;div style="line-height: normal;"&gt;any one have idea how to get the same shape rendered even if I changed render target size , I struggled to do so and no result&lt;br /&gt;
&lt;/div&gt;</description><author>eng_shaker</author><pubDate>Tue, 16 Apr 2013 14:23:36 GMT</pubDate><guid isPermaLink="false">New Post: is SpriteFont::DrawString  dependes on render target size 20130416022336P</guid></item><item><title>New Post: Building failing for Windows Phone XAML + Direct3D project</title><link>http://directxtk.codeplex.com/discussions/440177</link><description>&lt;div style="line-height: normal;"&gt;I'll add $(SolutionDir) as recommended in the docs.&lt;br /&gt;
&lt;/div&gt;</description><author>walbourn</author><pubDate>Sun, 14 Apr 2013 06:01:26 GMT</pubDate><guid isPermaLink="false">New Post: Building failing for Windows Phone XAML + Direct3D project 20130414060126A</guid></item></channel></rss>