Skip to content

Latest commit

 

History

History
68 lines (66 loc) · 1.79 KB

API_FORMATTING.md

File metadata and controls

68 lines (66 loc) · 1.79 KB

Framework API Formatting

  • .new(allocator) *Self, .free(allocator, self)
      • New: init/create/build a new instance of the structure.
    • Free: allocator will destroy the instance after calling a clean method
      • This will be a struct function that will be passed a pointer to the instance. This will allow for cleaner game files if the allocator destory is handled by the free function itself. 1 call rather than two.
      • Examples:
        • Player.free(allocator, player);
        • VertexArray.free(allocator, vao);
  • Naming:
    • Local Variables:
      • snake_case
    • Global(non-const):
      • snake_case
    • Global(const):
      • SCREAMING_SNAKE_CASE
    • Structures:
      • PascalCase
    • Functions and methods:
      • camelCase
      • return: type
        • PascalCase
      • setters/getters:
        • setIndex()
        • index()
        • setId()
        • id()
    • File Names
      • snaking_case.zig
      • Platform Specific Implementations:
        • name_platform.zig
          • texture_opengl.zig
          • texture_vulkan.zig

Refactor Progress:

  • main.zig

Sandbox

  • player.zig

Utils

  • profiling/frame_statistics.zig
  • file_loader.zig
  • math_helpers.zig
  • timer.zig
  • strings.zig

Core

  • application.zig
  • color.zig
  • input.zig
  • matrix4.zig
  • vector2.zig
  • vector3.zig
  • resource_handler.zig

Renderer

  • backend/renderer_opengl.zig
  • backend/framebuffer_opengl.zig
  • backend/texture_opengl.zig
  • backend/vertex_buffer_opengl.zig
  • backend/vertex_array_opengl.zig
  • backend/index_buffer_opengl.zig
  • backend/shader_opengl.zig
  • backend/shader_program_opengl.zig
  • cameras/camera_2d.zig
  • font/font.zig
  • font/glyph.zig
  • framebuffer.zig
  • renderer.zig
  • sprite.zig
  • texture.zig