Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

307 Neutral

About xyzzy00

  • Rank
  1. xyzzy00

    D3DXFONT on Win98

    Check the parameters to your function. I think "Arial" is spelled incorrectly. xyzzy
  2. D3DXCreateTexture and D3DXLoadSurfaceFromMemory should do that for you, I believe. If you want to be really explicit about it, call D3DXCheckTextureRequirements beforehand to get the corrected dimensions and format. xyzzy
  3. Generating a TGA in memory just to feed to D3DX is a bit overkill, I think. Use D3DXCreateTexture to create an empty texture of the dimensions you want. Use D3DXLoadSurfaceFromMemory to load your texture data into the first mip level. Use D3DXFilterTexture to filter that image down to the remaining mip levels. xyzzy
  4. xyzzy00

    FXC error

    Run FXC with the /Vd option, and look at the way the constants are arranged in the disassembly. Something about the code generation probably changed between the two versions of the compiler. If you were close to the limit before, there is a chance that the change pushed you over the edge. If it looks like the compiler is doing something completely brain-dead now, post your shader here, and send it to directx@microsoft.com. xyzzy
  5. Why do you composite all your textures together using D3DXLoadSurfaceFromSurface? I think it would be faster to just draw a batch for each side, than to composite textures together so you can draw the cube in a single batch. xyzzy
  6. Quote:Original post by Nairou Doesn't hardcoding the registers interfere with the compiler efficiency?Nope. Just pack them nicely so that you are setting the fewest number of constants with each call to SetVertexShaderConstantF. Quote:Original post by Nairou So, even with all of the extra code and overloaders and differently-named variables, as long as the specific sequence of data types is the same, it can be cast away? And just assume it works?Correct. If the layout of the data is the same, how you interpret it is up to you. Just make sure that your matrix class has the same layout, and has no virtual methods. xyzzy
  7. There is nothing in D3DX that you couldn't write yourself, given the time, knowledge, and inclination. You CAN use SetVertexShaderConstantF to bypass using ID3DXConstantTable. The easiest way to do this is to specify explicit register bindings for all of your uniform variables in your shader. For example: float4x4 cWorldViewProj : register(c0); sampler sDiffuse : register(s0); These bindings instruct HLSL how to lay out your constants and samplers. Now, since you know exactly where they all will be, it should be easy to use SetVertexShaderConstantF to update your constants. As far as converting from your matrix class to D3DXMATRIX: Assuming that your class stores the matrix values in exactly the same order as D3DXMATRIX, you can simply cast it: *(D3DXMATRIX*) &myCustomMatrixxyzzy
  8. xyzzy00

    hlsl struct

    You are missing semicolons after your struct definitions. xyzzy
  9. xyzzy00

    Various HLSL Compiler Errors

    It fails because 'out' is a reserved word in HLSL. Change it to any other name, and it will magically work. HLSL uses 'in', 'out', and 'inout' to specify how function parameters are passed. Parameters marked 'in' (default) and 'inout' are passed by value when the function starts. Parameters marked 'out' and 'inout' are returned by value when the function exits. xyzzy
  10. This is not an easy problem to solve. There is not a 1:1 mapping of unicode characters to glyphs. Depending on the language a character's neighbors, a character may map into zero, one, or multiple glyphs. Hindi is a good example of this, since glyphs are usually formed by the composition of two characters. The other problem you will encounter is that while you think Windows Edit control is using a single font to render english, hindi, and arabic characters, this is not the case. There is a font substution table, and it switches fonts on the fly if the font you are using does not contain required glyphs. Unfortunately, I don't think there is a good way to get this information from Uniscribe. Good luck. xyzzy
  11. Easiest way is probably to just stick an 'A' on the end of the name.. D3DXCreateTextureFromFileA.. to call the non-unicode version of the function. xyzzy
  12. The docs for these functions describe what they do in pretty good detail. Given this, it should be pretty trivial to implement your own versions of these functions. xyzzy
  13. xyzzy00

    Begin() and End() for ID3DXSprite

    You want to put as many calls to Draw between Begin and End as possible to take advantage of batching. ID3DXSprite (or anything else in D3DX for that matter) doesn't do anything that you couldn't do yourself, given the time and incination. D3DXSprite batches your calls to Draw, sorts them, and calls D3D with VB of textured quads to draw. xyzzy
  14. xyzzy00

    HLSL - problems with isinf(x) function

    You're right: "isinf()" will work with scalar, vector, or matrix types. It will test each component and return a similarly sized scalar, vector, or matrix of booleans. The "if()" statement requires the condition to be scalar. What you probably want to write is: if(any(isinf(my_vector))) // do something xyzzy
  15. xyzzy00

    Question about Fonts in directx

    Of course. Just set the surface you want to render to as your current render target before drawing your text. xyzzy
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!