Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Sep 2011
Offline Last Active Today, 03:25 PM

Posts I've Made

In Topic: Destructor in vector called too often

Today, 03:21 AM

Would still be nice though if anybody with visual studio 2013 or the 2012 November compiler CTP could also test the code and confirm that this is happening for him too.


I'm sorry to say that I can't reproduce the problem with Visual Studio 2013 Update 2.

In Topic: How can I display Unicode characters like "ä" or "语" in my game?

19 August 2014 - 12:40 AM

DirectWrite uses a 2D render target. I don't know if and how I can use this for a 3D game with a 3D render target...


Combining DirectWrite/Direct2D with D3D11 is definitely possible. I used them both for a project a while ago (it used SharpDX, but that doesn't really make a difference). Unfortunately, I don't have access to that project right now.


SpriteFont uses Windows 8.1 SDK and DirectX 11.1 math. Will it work with Windows Vista, Windows 7 and Windows 8(.1) and on graphic cards that only support DirectX 11?

DirectXTK should be usable on all platforms that support DX11 (you can still use a lower feature level). According to the Codeplex page, Vista SP2 and higher are supported.


And is there a way to get the size of the text before it is rendered? I need to know the width of each word (or letter) to implement scrolling, so how can I do this with DirectWrite or SpriteFont?

SpriteFont provides a MeasureString method that returns the size of a given string in pixels.

DirectWrite allows you to do get all kinds of information on the text to be rendered and implements many formatting options.

In Topic: How Would You Make A Quad Based On a Direction in 3D.

18 August 2014 - 07:26 AM

Some pseudocode: 

dir = normalize(target - start)
up = (0, 1, 0)
halfSize = size / 2

// todo: handle case when (dir == up)
o1 = cross(dir, up) * halfSize
o2 = cross(o1, dir) * halfSize

p1 = start + o1 + o2
p2 = start + o1 - o2
p3 = start - o1 - o2
p4 = start - o1 + o2

In Topic: How can I display Unicode characters like "ä" or "语" in my game?

18 August 2014 - 07:09 AM

What about DirectWrite?

In Topic: [SharpDX] Unable to render texured models using BasicEffect

15 August 2014 - 03:06 AM

When you inspect the loaded model in the debugger, what do the InputElements in the VertexInputLayouts look like? Do they include a "TEXCOORD" element? If they don't, are you sure that your model contains texture coordinates?

The SharpDX Toolkit automatically chooses an appropriate Vertex struct and corresponding VertexInputLayout for you. If there is no InputElement for texture coordinates, the model compiler probably wasn't able to find any texture coordinates in the source model.