• Advertisement

obi-wan shinobi

  • Content count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About obi-wan shinobi

  • Rank
  1. Windows OS demographics & Direct3D

    Supposing I want to stick to native DirectX (or possibly SlimDX) for a simple game, should I learn D3D10 & D2D and neglect non Vista/Win7 users, or stay with D3D9? More specifically: Are the new DirectX graphics APIs easier to learn or better in forming coding habits? Should I start learning the new APIs now since they should be used more in coming years as WinXP loses support? Where can I find accurate numbers on the amount of homes that use a particular version of Windows and their system specs?
  2. Can This Be Done? [SFML]

    I know you can take a font's image and get the texture of that using: sf::Font font; font.GetImage(); and using the image as a OpenGL texture, but this will just yield a texture of randomly placed letters and symbols. Unfortunately, I don't think there is a way to combine strings into a single texture in SFML. I know SDL and its variants can do it, but unless you'd take the OpenGL texture above and write your own code to replace the random characters with your formatted text, SFML likely doesn't allow it.
  3. VC++ link errors and antivirus issue

    Migrating the source files to another project worked, but rebuilding the old project in VC++ still give the same linker error. Cleaning the project and building gives the error too. About fstream and c++, I do know how to use it and would have preferred to, but for whatever reason, I had trouble getting it to work in my project so far. What I meant by "though at least the FILE object verified that the file was present and opened" was that code such as if(file != NULL) cout << "Success" << endl; else cout << "Failure" << endl; will print "Success" after a call to fopen(file, "r"), even though trying to read even the first line would cause a crash, and writing to a file opened with "w" presented no problems whatsoever. I'll try fstream again in this new project and probably post whatever code and errors I get from it.
  4. VC++ link errors and antivirus issue

    So, in the process of trying to build a level parser for my SFML project, I try some file loading code using a FILE object and an istream object, but neither seemed to want to read a file, though at least the FILE object verified that the file was present and opened. The strange thing is that elsewhere in my code, I had another FILE object that was writing debug messages to a text file and this had no problems opening the file or writing to it. The problem is that after crashing a few times, my application was targeted as malware by AVG antivirus and placed in the virus vault. I had to restart my system in order to scan it, after which no viruses were found. The message from AVG itself listed "conhost.exe" as a system process that was connected to my game executable in the Release folder of VC++ 2008. Oh, and no matter how many times I try, the code will not create an executable in the Release configuration anymore, though the Debug configuration will (as long as I don't mind using the Debug dlls). 1>LINK : fatal error LNK1104: cannot open file 'C:\Users\user_1\Documents\Visual Studio 2008\Projects\sfml_cpp_1\Release\sfml_cpp_1.exe' That's the error message I've been getting ever since my level parsing code has had a problem. FILE *test; char *text; test = fopen("debugtext.txt", "r"); fgets(text, 35, test); int l = strlen(text); // insert null terminator over the newline text[l-2] = 0; cout << "File output: " << text << endl << "Output length: " << l << endl; This is the code similar to the code that crashed my program and was assumed to be malware, except it had no problem working when I tested it. Does anyone have any good idea on why this happened or has this happened to others?
  5. About XInput and other APIs

    Thanks for the reply. I'll test out XInput after checking the samples and reference again...
  6. Just a few quick questions: 1) Can I use XInput outside of DX/XNA apps, or are there technical/legal issues with doing so? (e.g., using XInput in SFML to get extra XB360 pad functionality) 2) Are there other input APIs (not DirectInput) that can work in any SFML/DX/SDL/etc application comparable to how irrKlang works without needing a specific windowing API to just play a sound? My point in asking these questions is to hopefully find a way to make a game that can rather simply support many gamepads with as much functionality as possible.
  7. alpha in a simple triangle

    Thanks for the responses. I've gotten transparency to work somewhat through alpha blending in D3D using the SRCBLEND and DESTBLEND flags, though it feels like instead of transparency at one point, the triangle just dilutes the color at that point yet anything behind it can't be seen clearly (such as another triangle). Maybe the default shading has something to do with it? Weirdly enough, I had been using the glBlendFunc function in OpenGL for a while and never really noticed that it does what I was looking for in the original post; instead it felt more like it was the only way to get colorkeying to work on any texture being used (as seen in the NeHe tutorials).
  8. alpha in a simple triangle

    While I know how to make a simple triangle and change the color of each vertex, how do I change the opacity of each vertex and make it actually work? Is it even possible to have something like a fully opaque red vertex, a semi-transparent green vertex, and a fully transparent blue vertex? I've messed around with a few things in D3D and OpenGL but I can't get it right, and it doesn't look like there are that many tutorials on the subject. Also, I don't (think I) want to use blending to blend several triangles to get this effect.
  9. For an indie game that I might get around to coding if I could decide on things like language, SDK, and so on, is it really worth it to hide things from the player? Besides the source code, do I really need to spend lots of time hiding sprite sheets or certain scripts for things like preventing a player from spoiling parts of the game while poking around in the install folder? Also, how would I do something like this when most of what I see for loading media accepts common file types (.bmp, .wav, etc)? I've considered making my own custom file formats, converting them into a common type during runtime, then deleting the converted file after it's loaded, but that has the problem of revealing the converted file if the program is closed before the deletion. I'm also unsure if temporary files in memory could do the same thing, or how to get this to work in DirectX. I am aware that even professionally-made games aren't immune to modding or hacking, and that while C# could get me results quicker, it's also gonna be much easier to reverse engineer than using C++. Are there any tutorials or general advice on using certain techniques to hide certain game data, such as using cryptography for dialogue text, or functions that allow simple pixel placement rather than needing a bitmap?
  10. Problem with SDL.NET 6.1 and glGenTextures

    Apparently, the GL calls were going before SetVideoMode was called...using static classes means the objects were being created when the first function of the static class was called rather than at some earlier time as I had thought. The problem was really that I didn't know how static classes work compared to non-static classes (and that it's just being brought up now). Thanks for helping!
  11. Problem with SDL.NET 6.1 and glGenTextures

    All calls to OpenGL come after SetVideoMode returns the video surface. The code itself is mostly taken from the NeHe texture loading code that comes with the SDL.NET SDK (tutorial #6 or 8). The application currently only uses one thread and I've never even considered multithreading.
  12. Problem with SDL.NET 6.1 and glGenTextures

    I didn't think I'd have to explicitly create an OpenGL context -- doesn't the SetVideoMode constuctor do that automatically when the opengl argument is set to true?. Besides, as my code is now, everything in GL works (that is: glBegin, glEnd, glVertex, glTexCoord, etc). The problem here is that I only get one texture name when there should be more. Similar code in either SDL or Pygame produces the correct effect so I don't know why it does something else with SDL.NET in use. As far as I can tell from cs-sdl.sourceforge.net, there's no bug report on it.
  13. Using SDL.NET's OpenGL functions, I try to generate several textures like this: int[] textures = new int[5]; //array space for five unique textures Gl.glGenTextures(5, textures); //attempt to generate 5 texture names foreach(int i in textures) Console.WriteLine(i); //print out the integers The problem here is that when I print out the integers, they are all the same number and it becomes impossible to use more than one texture at a time without constant overwriting and the performance loss that causes. In SDL.NET, the output would be 0 0 0 0 0, whereas in Pygame or SDL, it would be 0 1 2 3 4. Even using the overloaded version of glGenTextures that takes an IntPtr type instead of int[], the only output given is 0. What could be causing this?
  14. Making a game run in D3D9 or D3D10

    I've thought about making a game that would run in D3D9 on any Windows before Vista and in D3D10 for Vista or Windows 7, mostly as a way to learn about D3D10. However, I'm likely not going to be using advanced techniques like shaders, bump mapping, and so on. For a simple game that would mostly be textured quads and sprites, would it be better (or easier) to just run it in D3D9 on every Windows OS and leave D3D10 out? Or does D3D10 really have some significant benefits for beginners that D3D9 does not?
  15. General lighting questions

    I've checked the documentation on the www.opengl.org and know what the accepted values are for the lighting parameters, but if I make them something besides the default, the light can't be seen. The scene is set up such that there are 4 walls (400x400) in the -x, +x, -y, and +z directions, each 200 units away from the origin. The walls are different colors. Also, 2 faces of an unfinished cube (50x50) on the y and z axes near the origin rotate to show the light reflecting on it. If I only go back to the cube and turn off all materials, the cube will mostly show one color (Diffuse?) and show another color not so much (Ambient?). The light itself has y and z coordinates that don't change and are inside the 4 walls mentioned above.
  • Advertisement