Jump to content
  • Advertisement

Jaywalk

Member
  • Content Count

    167
  • Joined

  • Last visited

Community Reputation

250 Neutral

About Jaywalk

  • Rank
    Member
  1. Jaywalk

    Telnet over UDP?

    Do they let you host SSH? If so, it might be a good idea to run your MUD through that.
  2. Jaywalk

    Where can i get openGL 3.0?

    For VC++E, you get the OpenGL headers and libraries when you install the Windows Platform SDK.
  3. Jaywalk

    Problems with Alpha Blending

    Don't worry, this problem catches just about everyone when they're starting out. I'll assume you know how a depth buffer works. The tree in front is drawn first, and for every pixel drawn, no matter how opaque or transparent, the depth is written to the corresponding "pixel" in the depth buffer. Later, when the tree behind is drawn, the rasteriser will look at the depth buffer and see decide that there is already something in front so it will skip drawing the pixel of the rear tree entirely. I hope that made sense, otherwise I'm sure someone else can explain it better. There are two simple ways to avoid this problem: 1) Read up on alpha testing. Before drawing the billboards switch alpha blending off and turn alpha testing on. This approach is very simple and robust way to get transparency without any depth buffer issues, but has the obvious drawback that without blending you don't get any partial transparency, which also means you lose any antialiasing in the texture. I suggest that you try this approach anyway, because you might find in this case that the loss of blending doesn't matter. Alternatively 2) Depth-sorting. Leave blending on but when you draw the billboards figure out the distance of each one from the camera and make sure that the billboards are drawn in order from furthest to nearest. The second approach takes a little more work than the first and will probably perform very slightly worse, but doesn't compromise the image quality. Certain cases might favour one approach over the other, but for your case either one should be just fine.
  4. Jaywalk

    *sigh* Need assistance with this...

    "First-chance exception at 0x76bbcd2e in Engine.exe: 0xC0000005: Access violation reading location 0xcccccccc." That sounds almost certainly like an uninitialised pointer variable. Are you using an IDE (such as Visual Studio)? If so then you should be able to do a debug run and see on what line the program crashes. Then, you can look in the "Autos" window and see if any pointer variables have the value 0xcccccccc.
  5. Jaywalk

    What is so open about OpenGl?

    Close. It is indeed an open specification. What it means is that OpenGL is a specification that's open for anyone to implement (although you do need to pay a licence fee and go through a conformance test before your implementation can use the OpenGL trademark). SGI made the original specification and had there own implementation, Microsoft used to have an implementation of their own, and I believe nVidia and ATI each maintain their own seperate implementations of the OpenGL standard. From Wikipedia: At its most basic level OpenGL is a specification, meaning it is simply a document that describes a set of functions and the precise behaviours that they must perform. From this specification, hardware vendors create implementations - libraries of functions created to match the functions stated in the OpenGL specification, making use of hardware acceleration where possible. Hardware vendors have to meet specific tests to be able to qualify their implementation as an OpenGL implementation.
  6. Right now I'm trying make my code be able to describe the input devices available. I can find all HID devices using GetRawInputDeviceList and can obtain descriptive information by getting the device name for each device from GetRawInputDeviceInfo and using the name to find the corresponding registry key under HKLM/SYSTEM/CurrentControlSet/Enum. But how do I list and describe the inputs on a device? How would I go about finding what keys, buttons, axes etc. a device has?
  7. From experience using both APIs quite frequently, it really doesn't matter which one you choose. Once you're comfortable with either one you'll be able to pick up the other and hop back-and-forth easily. I'm inclined to suggest that you stick with OpenGL so that you can get a grip on the concepts without having to start all over again. Then when you inevitably work on a DirectX project it will be simple to look in the docs and ask "How do I do what I was doing in OpenGL, but in DirectX?". On the other hand, if you feel like it then by all means feel free to take DirectX instead. It's actually a very short-term decision, not a lifelong commitment, even though it may seem that way at first. Either way, here are some suggestions to make the learning process easier: -The biggest and most complicated part of either API is the fixed function pipeline. I recommend that you ignore it completely - the programmable pipeline is better and easier, and hardware support is pretty much ubiquitous these days. -Learn how to write vertex and pixel shaders (easy if you keep it simple - BTW in OpenGL these are referred to as vertex and fragment programs), and draw batches of polygons using those shaders. Then throw in textures and maybe render targets and that's pretty much all the tools you need from the API to do some amazing graphics. Simple, isn't it? -Is window-handling or other menial code distracting you from what you're actually focusing on learning? Just use SDL and it will all be taken care of for you. Works with DirectX, OpenGL, or even just by itself. -If you want access to the latest OpenGL features, you can use a library such as GLEE. (alternatively there as the GLEW library, which does the same thing but gives you a bit more control). With DirectX you can access new API features by upgrading your DirectX API.
  8. I trick I use for that situation is to use NASM to build the text file into an object which can be linked into the program. Let's say that you want to have a C array called textfile which contains the file textfile.txt. Have NASM assemble the following code into an ELF .o (or whatever object format you're using) which gets linked into your program textfile: incbin "textfile.txt" DB 0 Congratulations, you now have the text file linked into your program as an ordinary C string. All you need to do is declare it in your code or a header file. extern char textfile[];
  9. Jaywalk

    Ogg on DirectSound

    I should mention that I personally don't use any DirectMusic interfaces at all, so I can't comment on how AudioPath and Performance behave. For 3D sound with only DirectSound all you really need is a listener and a regular IDirectSoundBuffer buffer. The buffer must be created with DSBCAPS_CTRL3D and should also be mono (as far as I know, non-mono sounds can't use DSBCAPS_CTRL3D). You can then use the IDirectSoundBuffer::QueryInterface with an interface ID of IID_IDirectSound3DBuffer8 to retrieve a IDirectSound3DBuffer interface. These are actually two different interfaces to the same buffer - you need to use both together to to 3D sound. The IDirectSoundBuffer has playback methods and the IDirectSound3DBuffer has methods to set position and velocity.
  10. Jaywalk

    Ogg on DirectSound

    There comes a point at which sound files become too big for preloaded samples to be a good idea. When this happens, you should use streaming. You don't need to touch DirectMusic interfaces at all. What you should do in this case is have a smallish DirectSound buffer (I found that a 64k buffer works well) and use this to stream directly from the ogg file. Instructions for how to do this are in the DirectX9 documentation at DirectSound->Using DirectSound->DirectSound Buffers->Using Streaming Buffers Naturally, the DirectX docs don't tell you how to read ogg files. If it's ogg vorbis that you want then I recommend using the vorbisfile library for reading.
  11. Jaywalk

    Help with a .bat?

    I don't know the answer, but I can offer a suggestion. Put a pause in the .bat file so that you can see the error message, and then tell us what the error is, so we can give you a more educated answer. set PATH=%PATH%;%JAVA_HOME%\bin java -cp protoShipXWR098.class pause
  12. Jaywalk

    Load PNG

    There's little need for libraries to create OpenGL textures for you, because it's very simple to create an OpenGL texture from the raw image data. First, you load the image using one of the libraries mentioned. Now, if that worked, you can create the OpenGL texture to store the image. int texture_id; glGenTextures(1, &texture_id); // create 1 texture and store its ID in the variable texture_id Next you write tell OpenGL that the texture must use the pixel data that you have loaded. Assuming that the image is RGBA format, that the variable named "pixels" is a pointer to the raw pixel data, and that "width" and "height" contain the width and height of the image, do this: glBindTexture(GL_TEXTURE_2D, texture_id); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_CHAR, pixels); Once this is done, you no longer need the raw image data, so you can delete it delete pixels;
  13. Jaywalk

    dynamic arrays in STL

    Have you considered using std::set? From what you describe it seems to me that this is exactly the container type that you need. #include <set> /* ... */ // to define a set of pointers to class T std::set<T*> collection; // to insert a pointer to the set T*t = new T(); collection.insert(t); // to remove a pointer from the set - no need for iterators or indices collection.erase(t); // to traverse the collection and call some method for each element for (std::set<T*>::iterator i = collection.begin(); i != collection.end(); i++) i->method();
  14. The compiler doesn't really care which side you put the *, and most programmers can cope just fine if they prefer one style but encounter the other, so this isn't such a huge issue. I personally think that char* pointer = new char; looks clearer because you are defining a variable (pointer) as a certain type (char*). It is, however, misleading, because the compiler will associate the * with the variable. You can see a potential problem when defining multiple variables. char* var1, var2; In this case var1 is a pointer, and var2 looks like a pointer but is actually a char. Because of this, I always use put the * to the right char *pointer = new char; char *var1, *var2; Don't think of it as defining a variable (pointer) such that (pointer) is of type (char*). Rather, think of it as defining (pointer) such that what it points to (*pointer) is of type (char). That mindset is more along the way a C++ parser actually works, and will save some confusion when dealing with defining multiple variables. It also works to help understand the more complicated ways of writing constants. Consider this: const int *a; int const *b; int * const c; In the first case we define a variable (a) such that (*a) is of type (const int). So (a) is not a constant, but (*a) is constant. In the second case we define a variable (b) such that (const *b) is of type (int). Again the variable (b) itself is not constant, but what it refers to (*b) is constant. In the third case we define a variable (const a) such that (*a) is of type (int). Here (a) explicitly is a constant, but (*a) is not.
  15. Jaywalk

    single fire and repeated fire

    This is actually quite simple if you use a "cooldown" variable where you fire the missiles in your update function. The algorithm is like this: void update(int milliseconds) { if (missile_fire_cooldown > 0) missile_fire_cooldown -= milliseconds; else if (fire_missile_button_is_pressed()) { missile_fire_cooldown = missile_fire_interval; fire_missile(); }
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!