• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

egwenejs

Members
  • Content count

    86
  • Joined

  • Last visited

Community Reputation

125 Neutral

About egwenejs

  • Rank
    Member
  1. Well, after two days of trying, it appears that whoever implemented the FileFontEnumerator class in SlimDX didn't do so correctly. It implements the IEnumertor interface instead of the IDWriteFileEnumertor interface and that interface is not exposed through the API at all. Very disappointing.  Unless someone knows a way to turn SlimDX.DirectWrite.FontFile into SlimDX.DirectWrite.TextFormat, I guess i'll have to use a different API. *heavy sigh*
  2. I'm trying to load a custom font from a file using DirectWrite through SlimDX. I'm fairly certain I implemented my FontCollectionLoader and FontFileEnumerator correctly. I registered the loader with the DirectWrite factory. The problem the I keep getting is when I called SlimDX.DirectWrite.Factory.CreateCustomFontCollection I have no idea what to pass as the key and key size. Any help would be appreciated.
  3. Quote: did you release oldsurface? What do you mean oldsurface? Do you mean oldRenderTarget? I believe I call oldRenderTarget.Dispose() -- so the answer would be yes. Quote: what resources have been allocated The ones shown - SlimDX.Direct3D9.Device, SlimDX.Direct3D9.Sprite, SlimDX.Direct3D9.Surface for oldRenderTarget, my screen class which wraps a dynamic texture. I think i said that in the original post. Quote: is that the exact code that is in winmain and nothing else Well I said the code snippets in the original post draw to the screen correctly but the code shown causes a failure when the device resets. So, how could you assume that the code shown is all there is to the program? Quote: The information you give is very vague. Really? What's vague about it. The 3 complaints you had about it were all due to not reading through the post and just looking at the code. If you really need more information what information do you need? The way to me clarify my own vagueness is not by being vague yourself.
  4. So, is my question poorly phrased?
  5. I'm using SlimDX for my Direct3D9 app. I found something I don't quite understand the reasons why it happens this way and I was hoping someone could explain it to me. //The one that works Surface oldRenderTarget = device.GetRenderTarget(0); device.SetRenderTarget(0, currScreen.RenderingSurface); device.Clear(ClearFlags.Target, currScreen.BackgroundColor, 1.0f, 0); device.BeginScene(); spriteBatch.Begin(); currScreen.Draw(spriteBatch); spriteBatch.End(); device.EndScene(); device.SetRenderTarget(0, oldRenderTarget); oldRenderTarget.Dispose(); Where currScreen is where I encapsulate the drawing and updating for what I want to show on the screen and spriteBatch is a pretty thin wrapper for SlimDX.Direct3D9.Sprite and device is an instance of SlimDX.Direct3D9.Device //The one that doesn't work device.SetRenderTarget(0, currScreen.RenderingSurface); device.Clear(ClearFlags.Target, currScreen.BackgroundColor, 1.0f, 0); device.BeginScene(); spriteBatch.Begin(); currScreen.Draw(spriteBatch); spriteBatch.End(); device.EndScene(); device.SetRenderTarget(0, device.GetBackBuffer(0, 0)); So the second one draws correctly but when the device is reset it complains that all associated resources weren't released. But no other resources are being used but the dynamic texture and the sprite object which are definately being released beforehand. What's causing the problem? In the first one which works and there are no complaints on reset. The object in the oldRenderTarget is the back buffer. BUT, I dispose of it. Shouldn't that cause a problem? It doesn't. Why not?
  6. If you need a pen to draw in a different style then you need create a brush that draw in that style and then make a pen that uses that brush. You could probably use a TextureBrush EDIT: Sorry, I meant to say System.Drawing.HatchBrush
  7. Instead of being creative - if you're doing research why not try to 'solve' the chess problem. It's been done for checkers, so now someone should do it for chess. The link for checkers if you haven't seen is http://www.cs.ualberta.ca/~chinook/
  8. Yes, you can do something like that. What you need to do is: - Create a texture as a render target. - Get the surface of the texture. - Render to the surface - Use the newly render texture as desired. Hope that helps.
  9. Have you tried using DirectWrite?? or is that not in the beta yet??
  10. From the help file in the DirectX SDK it says: Quote:This method cannot retrieve data from a texture resource created with D3DUSAGE_RENDERTARGET because such a texture must be assigned to D3DPOOL_DEFAULT memory and is therefore not lockable. In this case, use instead IDirect3DDevice9::GetRenderTargetData to copy texture data from device memory to system memory. Sorry gotta be in the default usage pool to lock.
  11. I would do something more like this. In the player class, hold somewhere what key does what. Then you set your default keys in the constructor or load player prefences from a file. And use those values to compare to call the correct methods to move your player. class Player { public: vector2 location; //add something like this char leftKey; char rightKey; //etc.... Player() { location.x = location.y = 0; //setup default keys leftKey = 'a'; rightKey = 'd'; //etc... //If player setup prefence file with keys //loading them here would be nice. } } //then... vector2 choose_direction() { char key; key = _getch(); switch (key) { case leftKey: return vector2(0, 1); case rightKey: return vector2(-1, 0); case downKey: return vector2(0, -1); case upKey: return vector2(1, 0); default: return vector2(0, 0); } } An even better way is to use a std::map for key bindings instead of a named list of chars like I showed above.
  12. Quote:Original post by janta Well, since you gave it away, it's n(n+1)/2 in fact, and therefore the algorithmic complexity is equivalent to O(n^2) as n tends to +inf. No, it isn't. What you have only counts the i and k loops, so you need to add in the j loop too.
  13. Using DirectX is there a way to detect whether a monitor is widescreen or not before device creation? I was thinking of making a method that gets the adapter's current display mode and calculating aspect ratio from that. But, many widescreen monitors support 4:3 resolutions and the above method would give me incorrect results if the widescreen monitor is using a 4:3 resolution. So, what I'm looking to do is use or make a method similar to the XNA GraphicsAdapter.IsWidescreen property. Any ideas?
  14. If I was you I would change all instance of char* to string. If you ever need the array of chars you can always call the c_str() method on a string type. By changing char* to string will also fix your current dilema
  15. Game Maker