Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

252 Neutral

About andrewk3652

  • Rank
  1. Translation: Page flipping is faster because all you're doing is telling the video "Here draw this now." Double buffering requires an actual line by line copy, which takes considerably more time.
  2. andrewk3652

    Libraries for LINUX?

    if you decide to package it as a .tgz, do us all a favor and DON'T build it from the root of the drive. I don't want a game installing crap everywhere from /usr to /usr/local to /usr/lib .... I want to put it where I want it, unzip it, and have game/lib, game/bin, etc.... so I know where it all lives when I want to trash it.
  3. andrewk3652

    Renderware for PS2

    I would be asking some serious questions of your employer. Sounds to me like they run a pretty loose ship. (I don't know jack about RW personally, I'm just pointing out things about your employer that sound fishy.)
  4. Page flipping is a technique used to deflicker animations as they are being drawn to the screen; it is not best suited to any one type of game, as far as I know it is used in *every* game on the face of the planet, it's just a standard.
  5. http://libogc.aklabs.net Over the coming weeks, myself, the author of libogc, and a couple of other people will be documenting libOGC (an open-source library for developing software for your Nintendo Gamecube). The site also includes tutorials, and more is always forthcoming. Any who are interested are welcome to come and read, but please do not post or modify anything unless you know what you're talking about. We all do, and that's why we're doing it. :-)
  6. andrewk3652

    Renderware for PS2

    RTFM If you do not have the FM bitch to your lead programmer, and he will get you the FM (which they should've had sitting, waiting for you on your self, the first day) [Edited by - andrewk3652 on January 11, 2005 12:35:42 PM]
  7. <skipping most of the posts> ... okay, so you're mad that there is no Linux IDE that supports multiple languages, custom compilers, is bug-free, and handles most everything transparently? What nitwit hasn't heard of Slick Edit? All that and more. For the meager (by comparison to many tools) price tag of $300. And if you can't afford slickedit, Eclipse is fantastic. I don't ever have the problems you're describing (though granted I only use it occasionally). As for the "open source software is crap", we all know where that ideology comes from and why it's espoused, so I won't get into a fight over it, I'll just say that it's total BS. A good 50% of the entire IT world runs on open source software. Sendmail, Apache, MySQL and SSHd daemons are spinning along quite happily under open source.
  8. andrewk3652

    Opengl lights limited to 8

    If you know how you want to change the light each time around, just use display lists in conjunction with your vertex buffers. IE, organize your vertex buffer to display the vertices that share common lights first, then change the lighting scheme and render some more, then render it again etc. You can still use vertex buffers it's just that you change the lighting and then run more indices. what's the big deal?
  9. That apparently fixed it Thanks much (I thought SDL included windows.h by default on the windows dev libs. my bad)
  10. Attempting to compile anything on MSVC .NET 2003 or MSVC 6.0 that contains any gl headers throws no less than 100 errors. And the worst part is, three files including the same gl header may produce two or even three different errors on the same line. To wit: (VC 6.0 output, .NET is similar) Compiling... md2loader.cpp c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found test.cpp c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found texturedpoly.c c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2061: syntax error : identifier 'glAccum' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2059: syntax error : ';' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2059: syntax error : 'type' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2054: expected '(' to follow 'WINGDIAPI' Here's the offending line in gl.h and the few lines surrounding it: /* For compatibility with OpenGL v1.0 */ #define GL_LOGIC_OP GL_INDEX_LOGIC_OP #define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT /*************************************************************/ WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value); WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref); WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); Anything that has WINGDIAPI in it creates problems. And as you can see the preceding lines are defines, so there's not a missing semicolon or something like that. VC doesn't even produce consistent errors. GCC at least is consistent when it fails. As you can see the first two find an unexpected EOF and the rest work just fine, with a host of other errors. What the hell is going on here?
  11. andrewk3652

    ATI drivers in FC3

    Getting an ATI card working under most Linux distros is something that I would categorize right next to raising the dead, under the "impossible" column. I will *never* buy an ATI card for just this reason. nVidia all the way.
  12. The point is that java has RTTI and the type of T shouldn't matter until runtime; that's the way java collections defined with <Integer> or whatever are checked, they're done at runtime. Sun themselves have said that generic types only exist at runtime and aren't checked until then. So why have they crippled javac to error out on a generic type? T not being a valid class would be handled just like a non-existant class during object de-serialization; with a NoClassDefFound error. Sun just had their heads up their ass when they did this. The ONLY purpose of Generics is to provide autoboxing for Sun's collection utilities. I don't see why they made it out to be more than it is.
  13. andrewk3652

    How can I simulate shooting?

    If you're moving the player within the world - and not the world around the player - remember to adjust your velocity positioning accordingly. What I mean is that the algorithm you've got - moving to the X, Y of the gunsight and going to MAX_DISTANCE on Z - is fine so long as your aircraft is oriented along the Z axis. The problem comes when the pilot banks left or right, or climbs up or down excessively. Then they become oriented along the X or Y axis instead of the Z axis. This is one of the reasons why it's popular to rotate and move the world around the player and leave them stationary. just an afterthought. An easier way would be to do a direct copy from the plane's vector, and give that to the bullet. Then just have it move in the direction of the vector at its velocity, thus eliminating the problem.
  14. I've got a LWJGL application that creates a little resolution chooser dialog before init'ing the LWJGL framework. The resolution chooser assigns itself to a new frame - so that it might be modal - and proceeds to get the user's options. Then the dialog turns modal off, goes invisible, and allows the main class to retrieve the user's options from it (by means of getXX functions). Well, the problem is that once the window goes invisible and turns itself non-modal, the main lwjgl window can't get the focus and I get no input! Help! here's the source, LWJGLFramework.java and ResolutionChooser.java. // ------------------------------------------------------------------ // ResolutionChooser.java package net.aklabs.game; import net.aklabs.awtutils.dialogs.AlertDialog; // ^^ you can take out the reference to this alert dialog if you want to // compile this, it's not essential, and I don't feel like posting the source // for the sake of brevity import java.awt.*; import java.awt.event.*; import java.util.*; public class ResolutionChooser extends Dialog implements ActionListener { private static final String[] resolutionStrings = { "640x480", "800x600", "1024x768", "1280x1024", "1600x1200" }; private static final int[] screenWidths = {640, 800, 1024, 1280, 1600}; private static final int[] screenHeights = {480, 600, 768, 1024, 1200}; private static final int[] bitDepths = {8, 16, 24, 32}; Choice res; Choice bitdepth; Button okBtn; Button cancelBtn; Frame theParent; public ResolutionChooser(Frame parent) { super(parent); theParent = parent; setModal(true); setLayout(new GridLayout(2, 2, 5, 5)); res = new Choice(); bitdepth = new Choice(); okBtn = new Button("Use These Settings"); cancelBtn = new Button("Cancel"); int c = 0; res.add("<Select a Resolution>"); bitdepth.add("<Select a Bit Depth>"); for ( c = 0; c < resolutionStrings.length ; c++ ) { res.add(resolutionStrings[c]); } for ( c = 0; c < bitDepths.length ; c++ ) { bitdepth.add(Integer.toString(bitDepths[c])); } setSize(300, 100); setTitle("Select your resolution"); add(res); add(bitdepth); add(okBtn); add(cancelBtn); okBtn.addActionListener(this); cancelBtn.addActionListener(this); setVisible(true); } public void actionPerformed(ActionEvent e) { if ( e.getSource() == okBtn ) { if ( res.getSelectedIndex() == 0 || bitdepth.getSelectedIndex() == 0 ) { new AlertDialog(theParent, "Please select a resolution", "Please select a resolution and bit depth", 275, 75, 0, 0); // ^^ this is the reference I said you could remove } else { setVisible(false); } } else { setVisible(false); res.select(0); bitdepth.select(0); } } public int getBitDepth() { int b = bitdepth.getSelectedIndex() - 1; if ( b > 0 ) { return(bitDepths); } else return 0; } public int getWidth() { int w = res.getSelectedIndex() - 1; if ( w > 0 ) { return screenWidths[w]; } else return 0; } public int getHeight() { int h = res.getSelectedIndex() - 1; if ( h > 0 ) { return screenHeights[h]; } else return 0; } public static void main(String[] args) { ResolutionChooser theRes = new ResolutionChooser(new Frame()); } } // -------------------------------------------------------------------- // lWJGLFramework.java // implements a simple LWJGL framework for your application= // copy/paste or extend this to make LWJGL apps // stolen (mainly) from the LWJGL demo application that bounced a white quad around the screen /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package net.aklabs.game; import net.aklabs.game.ResolutionChooser; import java.awt.*; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.glu.GLU; import org.lwjgl.util.vector.Vector2f; public class LWJGLFramework { /** Intended deiplay mode */ private DisplayMode mode; /** * Creates a FullScreenWindowedTest */ public LWJGLFramework() { } /** * Executes the test */ public void execute(int w, int h, int bd, int fps) { initialize(w, h, bd); mainLoop((int)1000/fps); cleanup(); } /** * Initializes the test */ private void initialize(int width, int height, int bpp) { try { //find displaymode mode = findDisplayMode(width, height, bpp); // start of in windowed mode Display.create(); glInit(); } catch (Exception e) { e.printStackTrace(); } } /** * Runs the main loop of the "test" */ private void mainLoop(int sleeptime) { while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) { if (Display.isVisible()) { // check keyboard input processKeyboard(); // do "game" logic, and render it logic(); render(); } else { // no need to render/paint if nothing has changed (ie. window // dragged over) if (Display.isDirty()) { render(); } // don't waste cpu time, sleep more try { Thread.sleep(sleeptime); } catch (InterruptedException inte) { } } // Update window Display.update(); } } /** * Performs the logic */ private void logic() { // put game logic here } private void render() { //clear background and do your drawing GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL11.glPushMatrix(); GL11.glPopMatrix(); } /** * Processes keyboard input */ private void processKeyboard() { //check for fullscreen key if (Keyboard.isKeyDown(Keyboard.KEY_F)) { try { Display.setFullscreen(true); } catch (Exception e) { e.printStackTrace(); } } //check for window key if (Keyboard.isKeyDown(Keyboard.KEY_W)) { try { Display.setFullscreen(false); } catch (Exception e) { e.printStackTrace(); } } } /** * Cleans up the test */ private void cleanup() { // Display.destroy(); } /** * Retrieves a displaymode, if one such is available * * @param width * Required width * @param height * Required height * @param bpp * Minimum required bits per pixel * @return */ private DisplayMode findDisplayMode(int width, int height, int bpp) { DisplayMode[] modes = Display.getAvailableDisplayModes(); for (int i = 0; i < modes.length; i++) { if (modes.getWidth() == width && modes.getHeight() == height && modes.getBitsPerPixel() >= bpp && modes.getFrequency() <= 60) { try { Display.setDisplayMode(modes); } catch (LWJGLException e) { e.printStackTrace(); } return modes; } } return null; } /** * Initializes OGL */ private void glInit() { // Go into orthographic projection mode. GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GLU.gluOrtho2D(0, mode.getWidth(), 0, mode.getHeight()); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glViewport(0, 0, mode.getWidth(), mode.getHeight()); //set clear color to black GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //sync frame (only works on windows) Display.setVSyncEnabled(true); } /** * Test entry point */ public static void main(String[] args) { System.out.println("\nPress W for windowed, F for fullscreen, and ESC to quit.\n"); System.out.println("\nYes, that's all I do. I'm a framework. Leave me be.\n"); /*ResolutionChooser theRes = new ResolutionChooser(new Frame()); int w = theRes.getWidth(); int h = theRes.getHeight(); int bd = theRes.getBitDepth();*/ // the above code would work, but it's like the resolution chooser // isn't letting go of the keyboard... I've got no input in the main // window after init'ing. LWJGLFramework lwjglFrame = new LWJGLFramework(); lwjglFrame.execute( 800, 600, 16, 30 ); } } (edit) I haven't slept in like 36 hours. Sorry if it's a mess or there's a bug in it that I don't even know about yet. [Edited by - andrewk3652 on December 30, 2004 2:04:46 PM]
  15. andrewk3652

    How can I simulate shooting?

    Just figure out how fast you want your bullets to move, how fast you want your guns to fire. So long as the player is holding down the shoot button, create a new bullet at the required interval; the bullet is just an object that has a velocity and position, and is displayed on screen as a little blur or a little bullet with a tracer behind it. They'd move super fast, and since you say you've already got collision code working, the rest is history. Just remember to have the bullets 'die' when they get a certain distance away from the player, or you'll wind up with memory leaks because you'll have a billion bullets extending on into infinity.
  • Advertisement

Important Information

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

GameDev.net 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!