Advertisement Jump to content
  • Advertisement

James Trotter

  • Content Count

  • Joined

  • Last visited

Community Reputation

432 Neutral

About James Trotter

  • Rank
  1. James Trotter

    Tricky question avec Texture LOD

    Quote:Original post by Promit Quote:Original post by James Trotter You can do it by yourself as well, using glTexImage2D, but I don't think there's much benefit. The standard approach in commercial PC titles nowadays is to generate the mipmaps offline, have an artist touch them up by hand, and then store the entire thing into a single DDS file. Ah, I didn't know. And thanks phantom for correcting that.
  2. James Trotter

    Tricky question avec Texture LOD

    Yes, OpenGL does mipmapping for you with gluBuild2DMipmaps. You can do it by yourself as well, using glTexImage2D, but I don't think there's much benefit. The performance might increase if there are alot of texture reads. You might save some memory as well, since it only needs to keep the smaller texture in graphics card memory when it's far away.
  3. James Trotter


    Quote:Original post by Anonymous Poster In most commerical products I have seen that use OpenAL, they tend to include the OpenAl32.dll in the same directory as the main executable. This is really to ensure that you are using the .dll your application was built against. Mr. Creamy It also saves the end user from having to install OpenAL. Maybe it's not finding whichever file it is you're trying to open and play with OpenAL?
  4. James Trotter

    small problem with source code

    You are expected to pass a reference to a pointer to an IDirect3DDevice9 object: IDirect3DDevice9 *d3d9; ... InitD3D(hInstance, 640, 480, false, deviceType, &d3d9);
  5. James Trotter

    glVertexAttribPointerARB problem

    You need to use glGetAttribLocation and pass the result as the second parameter to glBindAttribLocation: GLint loc = glGetAttribLocation(shader, "tangent"); glBindAttribLocation(shader, loc, "tangent");
  6. James Trotter

    GTK for games?

    Thought I'd post a little update. Maybe it'll be helpful to others who might be considering using gtk. I'm nearly finished rewriting the code to use gtk, and thus far it's working very well. I decided to use the C-interface, and not the C++ interface. The window handling is very nicely managed by gtk itself. The code is very high level, so you avoid the gritty details. I've only tested this on linux as of yet, but it should be fully portable without any changes. I also found the solution to gtk taking over the main loop. I found that it doesn't necessarily have to do so, and you can poll for events and update the gtk window and widgets whenever you like with the helpful gtk_main_iteration() function: // Update the gtk widgets while (gtk_events_pending()) gtk_main_iteration(); I found the gtkglext port of the classical gears application to be a very helpful example when writing the windowing code: Thanks for the help, guys.
  7. James Trotter

    smth's is wrong with material

    The pictures look like a classical case of Z-fighting. To correct this you might try to adjust the z-near and z-far values for the clipping planes or you can use glPolygonOffset. Here's some more information: Also, unless you're rendering maps using glEvalCoord, the glEnable(GL_AUTO_NORMAL) will do nothing. Quote: If automatic normal generation is disabled, the corresponding normal map GL_MAP2_NORMAL, if enabled, is used to produce a normal. If neither automatic normal generation nor a normal map is enabled, no normal is generated for glEvalCoord2 commands.
  8. James Trotter

    glTexImage2D problem

    Quote:Original post by cubicwang Thank you!!!!! Do you know the answer of my second question? Thank you very much! Welcome to China, I will be your cicerone. hehe, cool. You're welcome.
  9. James Trotter

    glTexImage2D problem

    Quote:Original post by cubicwang If use too many textures that out of the video memory, What will the opengl show to me? The failed of glGenTextures() or the glTexImage2D() failed? Thank you! Well, you must be using quite a few textures for that to happen. The driver will first move textures in and out of the graphics card memory and use the main memory, so it should have a lot to go on. If OpenGL does run out of memory, it will set a GL_OUT_OF_MEMORY error, which means there is not enough memory left to execute the command. It can fail on any call. You need to get this error with glGetError, and you can use gluErrorString to translate the error code into a more helpful string.
  10. James Trotter

    glTexImage2D problem

    Quote: C SPECIFICATION void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) PARAMETERS ... internalformat Specifies the number of color components in the texture. Must be 1, 2, 3, or 4, or one of the following symbolic constants: GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. ... format Specifies the format of the pixel data. The following symbolic values are accepted: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. ... The internalformat and format arguments should be valid in your case.
  11. James Trotter

    Keyboard & class interactions

    Quote:Original post by Juksosah Observer pattern seems good, since I don't think a lot of my game objects will need to 'listen' to the keyboard, thus avoiding inherance on a lot of classes. Paechy Keen I don't undertand well your method, maybe it's too advanced. If you could give an example, it would be nice. As for activating an action, I'm concerned about the action object itself. It suppose the use of inheritance (general action object from which, for example, the movement action is a sub-class) That's ok, but I think you can have tons of different actions in a game so tons of inheritance ahead. But maybe I didn't catch your ideas at all.. Continue posting ideas, as I see no one is handling the keyboard the same way. It surprises me. I really don't think you need a class for each action. It's much simpler to pass a function pointer when an instance of a class is registers for an event. That way, when the event occurs, the callback function will be called. To avoid having a different function for each event, you could register the same callback function for several events and use an if-else or switch, or whatever. Don't know if this really cleared anything up...
  12. James Trotter

    glTexImage2D problem

    Perhaps it could be the texture filtering? How are you setting that? The texture would appear blocky if you use GL_NEAREST. You should post more of your code so that we can try and figure out what's wrong.
  13. James Trotter

    Very basic shadow example

    It's not exactly basic, but these articles explain the standard way of doing shadows:
  14. James Trotter

    Keyboard & class interactions

    I haven't thought this through that well, and I'm sure someone will fill in the blanks with a more informative reply. I can imagine one way of doing it is to have the class 'subscribe' to the relevant input events. The 'keyboard class' would then call a function in the subscribed class once the event occurs. The observer pattern seems to provide a very natural way to do this.
  15. James Trotter

    Setting up Development in Linux

    Quote:Original post by TRYCORP I use code::blocks currently on windows and love it. With the Ubuntu install will everything be latest versions? Including gdb and everything. I'm not new to gcc or gdb by any means I have just been using them on Windows. I do use Slackware, but not for development. With Ubuntu coming up fast and if I'm not correct it doesn't support KDE defaultly anyway. In Ubuntu the default is gcc-4.0.3. Now, gcc-4.1.0 was released on 2006-02-28, so you won't be getting the newest, but gcc-4.0.3 works very well. Edit: It seems I was wrong. gcc-4.0.3 was released on March 10, 2006, and is actually newer than 4.1.0 [wink] Quote: Also, 512 MB of ram into the operating system is what Microsoft has published as recommended. XP Pro only needs 64 and suggests 128. I have an idea! How about Microsoft make a fast OS instead of a hold my hand whilst I send my e-mail OS. Yeah, yeah, yeah, you can get different flavors, including thier "Starter" (AKA CRIPPLED!), but I don't want "newb 'I <3 AIM' edition", "business edition", "HOME business edition", "Dead End Job Edition", "Do your taxes at home edition", or the almight "ULTIMATE EDITION!!" /** Insert Angelic Choir Here */ which I'm sure is where they crammed every useless feature they had into one big 2 DVD install in order to create a 200 page feature manual or something. Couldn't just keep Windows XP Pro? ... Quote:Original post by BBB jEdit (IMO 10 times better then KDevelop and Anjuta) Scons (better then GNU Make) Subversion ("Subversion is CVS done right") Never tried jEdit. Scons is beautiful. For a versioning system, be sure to check out Bazaar. Quote: About OpenGL: all the headers and libs you need should come with the nVidia-drivers (atleast it has worked for me). Don't know about ATI. You're right, I forgot. For ati, install the xorg-driver-fglrx-dev package.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!