• 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.

Del Snd of Thndr

  • Content count

  • Joined

  • Last visited

Community Reputation

190 Neutral

About Del Snd of Thndr

  • Rank
  1. Quote:Original post by Khaos Dragon Without Tao, would I have to individually wrap each opengl function into c++.net dll that could be loaded from my c# app? You could also use [DllImport] statements from within your C# project. This is how Tao works, IIRC (it's been awhile). However, I would definitely recommend using Tao, as making all those statements would be a pretty tall order; there are a lot of them. Plus, Tao already offers a nice control that would take considerable time to re-invent; this is true for me at least. Is there some reason that you do not want to use Tao? If it's something you hold against Tao, you could always use the C# basecode from NeHe, though it isn't nearly as complete or correct, at least of the time I last used it. If this is what you want, just look for the link on one of the sidebars on the left side of the page. At any rate, I would try to use some existing solution because wrapping the OpenGL library would probably take considerable time. And I'm lazy.
  2. I think the following line is the cause of the headache: .Select(match.Index, match.Length) It returns the index into the string that you matched against, not the character index in the text box; you would always select the index into the RichTextBox text instead of going to the line and then indexing into it. Here is some code that does it for you (and it gets rid of the annoying flickering [smile]) Hope this helps. Imports System.Text Imports System.Text.RegularExpressions Public Class Form1 Dim textColor As Color = Color.Black Dim syntaxColor As Color = Color.Blue Dim keywords() As String = {"apple", "orange", "grape", "pear", "banana"} ' this is used to prevent the flickering from all the selecting and deselecting Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Integer) As Integer Private Sub RichTextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged LockWindowUpdate(RichTextBox1.Handle) Dim selectionStart As Integer = RichTextBox1.SelectionStart ' stores the caret position Dim firstCharIndex = RichTextBox1.GetFirstCharIndexOfCurrentLine() Dim lineNumber As Integer = RichTextBox1.GetLineFromCharIndex(firstCharIndex) Dim currentLine As String = RichTextBox1.Lines(lineNumber) ' first, make sure that the entire line is set to the text color RichTextBox1.Select(firstCharIndex, currentLine.Length) RichTextBox1.SelectionColor = textColor ' build a regular expression string that contains all the keywords Dim builder As StringBuilder = New StringBuilder() For i As Integer = 0 To keywords.Length - 1 If i > 0 Then builder.Append("|") End If builder.Append("\b" + keywords(i) + "\b") Next ' get each of the matches and set the text color to the syntaxColor value Dim matches As MatchCollection = Regex.Matches(currentLine, builder.ToString(), RegexOptions.IgnoreCase) For i As Integer = 0 To matches.Count - 1 With RichTextBox1 .Select(firstCharIndex + matches(i).Index, matches(i).Length) .SelectionColor = syntaxColor .SelectionStart = firstCharIndex + matches(i).Index + matches(i).Length .SelectionColor = textColor End With Next ' set the caret back to its starting position RichTextBox1.SelectionStart = selectionStart LockWindowUpdate(0) End Sub End Class If you have any questions, feel free to drop me a line.
  3. Take a look at the ref and out keywords. The decision between which is used is more or less the context in which you are going to use it. ref requires that the referenced variable be initialized, whereas out does not. In the call to the function, be sure to use whichever keyword you deemed appropriate (it should match the one in the function definition). The variable is then passed by reference. The examples on the two pages should be enough to get you going. HTH.
  4. I think you need to poll your device before calling GetKeyboardState. See IDirectInputDevice8::Poll in the DX docs (or by clicking here). HTH.
  5. I'm not sure if this is what you are looking for, but check here. I've used this before - it's pretty straightforward to use. HTH
  6. Well, at least now I know. Thanks a lot for the reply. :)
  7. At work, we're developing a data visualization program based on the Earth. The data comes to us in a right-handed coordinate system, and we want to display the data in our Earth scene. The decision has already been made to use Managed DirectX to build our "engine." (I use the term very loosely.) However, it's kinda tough to think about plotting data from a right-handed coordinate system inside a left-handed one (at least for me, anyway!), so we have a small predicament on our hands. One idea being researched is drawing everything using the *RH functions (half of us were OpenGL programmers..). The other is converting data to a left-handed system, then plotting it (something I'm not necessarily opposed to). So we drew the Earth using a right-handed system, set the CullMode to CW, the works. However, in doing so, we ended up making M34 in the projection matrix negative. The MDX documentation says the following: In Microsoft Direct3D, the M34 element of a projection matrix cannot be a negative number. If an application needs to use a negative value in this location, it should scale the entire projection matrix by -1 instead. We didn't see any immediate consequences to doing this, but we're trying to make sure that everything is kosher before moving in that direction. Does anyone know the consequences of this? Please note that I didn't write the code, so I might have some of the facts wrong, but the question is right, this much I am sure. If I have some info wrong, please forgive my ignorance. Thanks in advance for your help.
  8. This is a stab in the dark, but did you install DirectX with Managed Extensions on the machine? This has been a source of a lot of our nightmares on our senior project at school (9.0c installed, but not the managed extentions...bah!). See this page for more info. It's an older page, but the first one I ran across when I went to look. HTH Edit: BTW, we got the FileIOException when we tried to run on the school machines, which is how we knew it wasn't there.
  9. Me too. I can't wait to get my hands on it; it looks great!
  10. You don't need to connect to Microsoft.Win32. Just put the Message struct and DllImport function definition in a class called "NativeMethods." That should do the trick. [smile]
  11. There was a thread around here at one point that addressed this issue, but I can't for the life of me remember when I saw it. If you change WindowMessage to uint, it should work okay for you. Someone here (sorry...it's in Google cache), even said that changing it to Int32 seemed to work without any problems (I guess you would use this if you wanted to write CLS-compliant code). HTH!
  12. To quote a Dilbert comic discussing Catbert's horrible customer service: "It works fine on my machine." In the past, I have had some problems with the IDE "forgetting" all the Intellisense information in the middle of writing a file...and this happened while I was writing an MDX program, oddly enough. A quick restart of the IDE solved all my problems then. If you haven't restarted it since the problem cropped up, I would recommend trying that. (If you have, let us know and we'll try something else. [smile]) A couple of other hints: you can use plain old HTML to post links, and you can use [_source lang="c#"][_/source] (just remove the underscores) to post your code in some nice boxes with syntax highlighting and everything. =) HTH!
  13. I'm not sure how to do this from the IDE itself, but you can easily edit your *.csproj file. All you have to do is open it up with Notepad and find the line that looks like this: <Compile Include="cGraphics.cs" /> Just change this line to look like: <Compile Include="cGraphics.cs"> <DependentUpon>cFleurin.cs</DependentUpon> </Compile> Now repeat the process with cInput.cs. If you do this while the IDE is open, it will let you know that the *.csproj file has been edited outside the environment, and it will ask you if you wish to reload it. Say yes, and you'll see that the two files now hang from cFleurin.cs. This method isn't the easiest, but it gives you a peek inside your project files (you can read the solution files just the same!) and kind of give you an inside look at what all the environment uses. This, I think at least, is pretty cool. HTH!
  14. Thanks for the speedy responses. I've implemented both and am much happier with the result.
  15. I'm currently working through Introduction to 3D Game Engine Design Using DirectX9 and C#, by Lynn Harris, and I have a question about a design decision that he evidently made for the book. In the book, he creates a heirarchy of classes that comprise a game engine for an outdoor racing game. The highest level class I have seen thus far is GameEngine, and it contains variables representing many of the other classes created throughout the book. SplashScreen is an example, and it is its Render function about which I have questions. The Render function performs several tasks, such as enabling fog, setting textures, etc. For these tasks, it is obvious that one would need a reference to a Direct3D.Device. In the book, Lynn creates a property in GameEngine that returns that Device, and SplashScreen.Render uses this property heavily. This translates into SplashScreen "knowing" about the higher-level class GameEngine. To me, this seems wrong. I can only think of one way that I would feel better about the OO design, and that would be to pass a reference of the device (through constructor parameters or a property) to the class, and leave the class ignorant of any class that may use it. OO Design is something with which I really struggle, and I want to get this right. So I ask, which approach, if either, is better and why? If both approaches have flaws, what is another approach? I really appreciate your help.