Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Blog Comments posted by Canardia

  1. Oh, you mean probably extreme OOP, with .Get/.Set style methods, like in C#:

    // Define objects
    Graphics graphics;
    World world;
    Mesh box;
    Camera camera;
    
    // Create graphics window
    graphics.Driver.Set( OpenGLGraphicsDriver() );
    graphics.Create(1024,768,4);
    
    world.Create();
    
    // Create a box;
    box.Create(1,1,1);
    box.Material.Shader.Load("Shaders/minimal.shader");
    box.Material.Color.Set(1,0,0,1);
    
    camera.Create();
    camera.Color.SetClear( Vec4(0,1,0,1) );
    
    box.Position.Set(0,0,-2,false);
    float yaw = 0.0;
    
    while (!window.Closed())
    {        
       yaw++;
       box.Rotation.Set(yaw,0,0,false);
       camera.Render();
       window.Flip();
    }

  2. I would do it like this:

    // Define objects
    Graphics graphics;
    World world;
    Shader shader;
    Material mat;
    Mesh box;
    Camera camera;
    
    // Create graphics window
    graphics.SetDriver( OpenGLGraphicsDriver() );
    graphics.Create(1024,768,4);
    
    world.Create();
    
    // Load a shader
    shader.Load("Shaders/minimal.shader");
    
    // Create a material;
    mat.Create();    
    mat.SetShader(shader);
    mat.SetColor(1,0,0,1);
    
    // Create a box;
    box.Create(1,1,1);
    box.SetMaterial(mat);
    
    camera.Create();
    camera.SetClearColor( Vec4(0,1,0,1) );
    
    box.SetPosition(0,0,-2,false);
    float yaw = 0.0;
    
    while (!window.Closed())
    {        
       yaw++;
       box.SetRotation(yaw,0,0,false);
       camera.Render();
       window.Flip();
    }

  3. Most, if not all C++ libraries use their own namespaces and constants. So you could say:

    #define LE_NULL NullEntity()

    and then use:

    TFormPoint( 1, 2, 3, LE_NULL, entity );

     

    You shouldn't worry about C++ features at all, since you need to make a procedural C++ DLL for other languages anyway, just like you needed to with BlitzMax. The BlitzMax DLL had no BlitzMax features either.

  4. I wouldn't make things more complicated than they really are. If the user deletes a texture of a material, he should do it from a method of the Material class, which should set the Texture pointer to NULL. Then the Material class can properly check for NULL textures.

    When the user destroys a texture which is used by other materials also, they should not stay visible! It would be like, WTF I just deleted the texture from the computer's memory, why is that material on that mesh still showing it, do I have to loop through the whole computer's memory to delete all copies? Why can't the engine do it automatically, since I definitely wanted to delete that texture, and I'm fully aware that it's used in many places?

  5. The ambient light areas ruin the overall quality, while the scene quality is very good else.

    SSAO tries to fix the quality loss abit, but you could turn off SSAO completely when using spot and pointlights.

    I would rather use 0,0,0 ambient light, and use spot and pointlights to illuminate too dark areas.

    I've seen some small scenes with a few pointlights, and they look really good when placed right (if you remember the scene with the dead lizardman laying on a stone).

  6. As long you keep saying developing in C++ is slower than in BlitzMax, then you are not sufficiently skilled in C++ yet, or you haven't written enough own standard functions which BlitzMax has (BlitzMax would be a horror without all the standard functions also).

     

    The main reason why I got pissed with BlitzMax was that it took over 5 minutes to start a real game in debug mode. So I figured BlitzMax is nice for small projects, but when things get real, it's not made for the power which is needed. Besides, I always liked the C++ syntax, even when I was professionally programming in Pascal at work. I always looked at C++ and thought that someday I will convert all my Pascal code to C++.

  7. This is not according to global standard:

    entity->SetPosition(x,y,z)
    EntitySetPosition(entity,x,y,z)	// error: standard violation!

    The standard says when using methods, the object comes first (since it's OOP), followed by the OOP seperator and then verb and subject.

    In procedural form verb comes first, then object and then subject (and of course the instance of object as first parameter):

    entity->SetPosition(x,y,z)
    SetEntityPosition(entity,x,y,z)

    This is easy to remember, since the procedural form is how you speak in real life too, and the OOP form only puts the object instance in front (so the object instance is not even part of the command, it's just the thing on what you operate).

  8. PC gaming is not dead, it's just that PC games are for people of over 6 years age (they need the motoristic muscle and brain skills to operate a keyboard with 105 keys and a mouse), and consoles are for people of 0-6 years age. Some people still don't follow this rule, I don't know why, because it's so simple.

  9. I would use the new C++0x standard, which is implemented in VS2010 C++ and GNU C++. This allows for example the use of rvalue references (&&), which makes code much faster since it implements true moving of references (copying of pointers only), while in the old C++ they were faked by copying (move vs copy constructor). This gives especially a huge speed boost when working with vectors, maps and other STL containers.

     

    See also:

    http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=480

    and

    http://thbecker.net/articles/rvalue_references/section_01.html

    and of course

    http://en.wikipedia.org/wiki/C%2B%2B0x#Rvalue_reference_and_move_semantics

  10. @Chris:

     

    The transparent GUI is done with SetBlend(BLEND_ALPHA) and DrawImage() commands. It's a custom GUI for LE, which I will include in gamelib 0.0.1.0 also (it's a separate gui.cpp and gui.h file, so it can be used also without gamelib by the infidels).

     

    The building parts are placed on a 1x1x1 meter grid, with an additional Y offset which can be controlled with the cursor up/down, end (=reset) keys. The mouse wheel rotates the part 90° cw/ccw.

×
×
  • Create New...