int enabled = 1 ;
if (enabled == 1 ) {
printf ("Is Enabled!" );
}
#include <stdbool.h>
bool enabled = true;
if (enabled == true) {
printf ("Is Enabled!" );
}
Structure instanciation ?
Vector3 vec = (Vector3 ){
0.0f ,
1.0f ,
-1.0f };
Vector3 vec = {0 };
vec .x = 0.0f ;
vec .y = 1.0f ;
vec .z = -1.0f ;
typedef struct MyObject MyObject ;
struct MyObject
{
int number ;
};
typedef struct MyObject
{
int number ;
} MyObject ;
set(game "../../game")
include_directories(
$ {game}/src
)
set(game "../../game")
include_directories(
$ {game}/src
)
Properties visibily naming ?
struct MyComp_State
{
int counter ;
};
struct MyComp_Props
{
int increment ;
};
MyComp_State Init (MyComp_Props props );
void UpdateMyComp (MyComp_State state , MyComp_Props props );
void RenderComp (MyComp_State state , MyComp_Props props );
MyComp_Private Init (MyComp_Props public );
void UpdateMyComp (MyComp_Private private , MyComp_Props public );
void RenderComp (MyComp_Private private , MyComp_Props public );
Mixing pointers and value ?
Launcher_State InitLauncher ();
int UpdateLauncher (Launcher_State * state ); // read/write function
void DrawLauncher (Launcher_State * state ); // read only
Launcher_State InitLauncher ();
int UpdateLauncher (Launcher_State * state ); // read/write function
void DrawLauncher (Launcher_State state ); // read only
// Camelcase
struct LauncherState
{
Texture2D texture ;
int durationInMs ;
clock_t clockAtStartup ;
};
// Snskecase
struct LauncherState
{
Texture2D texture ;
int duration_in_ms ;
clock_t clock_at_startup ;
};
struct LauncherState
{
Texture2D texture ;
int durationinms ;
clock_t clockatstartup ;
};