SoftPixel Forum

Official community of the SoftPixel Engine and the SoftPixel Sandbox (REGISTRATION only with consultation with the Admin)
It is currently Mon Apr 23, 2018 3:42 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Oct 20, 2012 9:11 pm 
Offline
Site Admin
User avatar

Joined: Sat Jul 07, 2012 5:58 pm
Posts: 540
Location: Germany
We are still looking for additional developer team members. If you want to join us in developing the SoftPixel Engine further, please note the following conventions:

  • All functions begin with a lower case letter (e.g. 'setPosition', 'renderScene' etc.).
  • All macros and enumeration constants are in upper case letter (e.g. 'MESH_CUBE', 'SHADING_GOURAUD' etc.).
  • When you write a new class use the following as your code template:
    Code:
    /*
     * YourClassName header
     *
     * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns)
     * See "SoftPixelEngine.hpp" for license information.
     */

    #ifndef __SP_CATEGORY_YOURCLASSNAME_H__
    #define __SP_CATEGORY_YOURCLASSNAME_H__


    #include "Base/spStandard.hpp"


    namespace sp
    {
    namespace CategoryNamespace_scene_or_video_etc
    {


    /**
    Your class description here.
    \since Version x.y
    \author YourName
    */
    class SP_EXPORT YourClassName
    {
       
        public:
           
            YourClassName();
            ~YourClassName();
           
            /* ... */
           
        private:
           
            /* ... */
           
    };

    } // /namespace CategoryNamespace_scene_or_video_etc

    } // /namespace sp


    #endif



    // ================================================================================

    Code:
    /*
     * YourClassName file
     *
     * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns)
     * See "SoftPixelEngine.hpp" for license information.
     */

    #include "YourClassHeaderFile.hpp"


    namespace sp
    {
    namespace CategoryNamespace_scene_or_video_etc
    {


    YourClassName::YourClassName()
    {
    }
    YourClassName::~YourClassName()
    {
    }


    } // /namespace CategoryNamespace_scene_or_video_etc

    } // /namespace sp


    // ================================================================================
  • C++ blocks should look like those:
    Code:
    void myFunction()
    {
        /* code here ... */
    }

    struct MyStruct
    {
        /* members ... */
    };

    {
        /* simple block ... */
    }

    Don't write those:
    Code:
    void myFunction() {
        /* ... */
    }

    void MyStruct { /* ... */ };
  • Do not use long and incomprehensible names for functions, variables and constants which shall be used by the user. Internal and private functions, variables and constants are allowed to be more complex.
  • Enumeration constants should have 'normal' names (e.g. FILTER_LINEAR) but both types (defines and enumerations) shall be always in upper case (not 'Filter_Linear').
  • Classes are also supposed to have normal names and not such as in other libraries, e.g. 'ITexture', or 'CAnimated3DSMesh', please use names like 'Texture' or 'SceneGraph'.
  • Only Structures, Enumerations and Unions should start with an identifier upper case letter to distinguish them between classes:
    Code:
    class MyClass;
    struct SMyStruct; // leading 'S' letter
    enum EMyEnum; // leading 'E' letter
    union UMyUnion; // leading 'U' letter
  • All private and protected Member Variables end with an underscore '_' (e.g. "dim::vector3df Position_;", "bool IsVisible_;" etc. and NOT "dim::vector3df m_Position;", "bool m_IsVisible;").

_________________
My latest project:
- The XièXiè Programming Language

My hardware:
- GIGABYTE GeForce GTX 670
- Intel Core i7 (Ivy-Bridge)
- 16 GB DDR3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group