repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
Yunori/Fridge-menu
controller/splash_screen.c
#include "../game.h" void reset() { my_putstr("\033[2J"); my_putstr("\e[0m"); } void show_name() { reset(); my_putstr("\e[0;31m"); my_putstr("\n\n\n .--,--.\n"); my_putstr(" `. ,.'\n"); my_putstr(" |___|\n"); my_putstr(" :o o: O Bienvenue dans l'interface Chappie\n"); ...
Yunori/Fridge-menu
functions/my_strncat.c
char *my_strncat(char *str1, char *str2, int n) { char *save; for (save = str1; *str1 && str1++;); for (; n; *str1++ = *str2++, n--); *str1 = 0; return (save); }
Yunori/Fridge-menu
functions/my_strncmp.c
<gh_stars>0 int my_strncmp(char *s1, char *s2, int n) { for (; n > 0; s1++, s2++, --n) if (*s1 != *s2) return ((*s1 > *s2) ? 1 : -1); else if (*s1 == '\0') return (0); return (0); }
Yunori/Fridge-menu
functions/my_str_to_wordtab.c
<gh_stars>0 #include <unistd.h> #include <stdlib.h> #include <stdio.h> int my_len(char *str); int my_word(char c) { if (c >= 'a' && c <= 'z') return (1); if (c >= 'A' && c <= 'Z') return (1); if (c >= '0' && c <= '9') return (1); return (0); } int my_len(char *str) { int i; for (i = 0;...
Yunori/Fridge-menu
controller/cuisiner.c
#include "../game.h" void recettes(FILE *fp) { int current = fgetc(fp); while(!feof(fp)) { if(current == ';') { nbr_ingredient(fp, current); current = fgetc(fp); } my_putchar(current); current = fgetc(fp); if(current == '\n') { current = fgetc(fp); break; } ...
Yunori/Fridge-menu
functions/my_strlen.c
<reponame>Yunori/Fridge-menu int my_strlen(char *str) { return ((*str) ? 1 + my_strlen(++str) : 0); }
Yunori/Fridge-menu
controller/start.c
<filename>controller/start.c #include "../game.h" void init() { my_putstr("\e[0;31m Veuillez selectionner le type de remplissage\n"); my_putstr(" 1) Random (etape 1)\n"); my_putstr(" 2) Fichier (etape 4)\n\e[0m"); get_type(); splash_screen(); } void get_type() { char *get; get = readLine(); ...
Yunori/Fridge-menu
functions/my_aff_tab.c
void my_putchar(char c); void my_put_nbr(int n); void my_aff_tab(int tab[], int len) { int compteur; for (compteur = 0; compteur < len; compteur++) { my_put_nbr(tab[compteur]); my_putchar('\n'); } }
Yunori/Fridge-menu
game.h
<reponame>Yunori/Fridge-menu<filename>game.h<gh_stars>0 #ifndef GAME_H_ # define GAME_H_ # include "my.h" typedef struct s_ingredients s_ingredients; struct s_ingredients { char *name; int qte; struct s_ingredients *next; }; typedef s_ingredients* t_ingredients; typedef struct s_recettes s_recettes; s...
Yunori/Fridge-menu
functions/my_strncpy.c
<reponame>Yunori/Fridge-menu /* ** my_strncpy.c for my_strncpy in /home/mages_i/piscine/C/jour_04/mages_i/my_strncpy ** ** Made by <NAME> ** Login <<EMAIL>> ** ** Started on Thu Oct 2 09:34:28 2014 <NAME> ** Last update Sat Oct 4 18:42:19 2014 <NAME> */ #include <stdio.h> char *my_strncpy(char *dest, char *src...
Yunori/Fridge-menu
functions/my_strcat.c
char *my_strcat(char *str1, char *str2) { char *save; for (save = str1; *str1 && str1++; ); while (*str2) { *str1 = *str2; str1++; str2++; } *str1 = 0; return (save); }
Yunori/Fridge-menu
main.c
#include "game.h" int main(int argc, char **argv) { init(argc, argv); return (0); }
Yunori/Fridge-menu
functions/my_put_nbr.c
<reponame>Yunori/Fridge-menu void my_putchar(char c); void my_putstr(char *c); void my_put_nbr(int n) { if (n == -2147483648) { my_putstr("-2147483648"); } else { if (n < 0) { n = -n; my_putchar('-'); } if (n < 10) my_putchar(n + 48); else { my_put_nbr(n / 10); m...
Yunori/Fridge-menu
functions/my_isneg.c
int my_isneg(int n) { return ((n < 0) ? 0 : 1); }
Yunori/Fridge-menu
functions/my_putchar.c
#include <unistd.h> void my_putchar(char c) { write(1, &c, 1); }
Yunori/Fridge-menu
functions/my_strstr.c
<gh_stars>0 #include <stdio.h> int my_strncmp(char *s1, char *s2, int n); int my_strlen(char *str); char *my_strstr(char *str, char *to_find) { char c; size_t len; c = *to_find++; if (!c) return (char *) str;// Trivial empty string case len = my_strlen(to_find); do { char sc; do { sc...
Yunori/Fridge-menu
functions/my_putnbr_base.c
void my_putchar(char c); int my_strlen(char *str); int my_putnbr_base(int nbr, char *base) { int re; int d; int len; len = my_strlen(base); if (nbr < 0) { my_putchar('-'); nbr = -1 * nbr; } for (d = 1; (nbr / d) >= len; d = d * len); for (; d > 0; re = (nbr / d) % len, my_putc...
Yunori/Fridge-menu
controller/stock.c
<reponame>Yunori/Fridge-menu #include "../game.h" void ingredients() { show_ingredients(); read_user(); } void update_qte() { char *name, *s_qte; my_putstr(" Quel ingredient voulez vous changer/ajouter ?\n > "); name = readLine(); my_putstr(" Combien y a t'il de "); my_putstr(name); my_putstr(...
Yunori/Fridge-menu
controller/parse_ingredients.c
<filename>controller/parse_ingredients.c #include "../game.h" void get_infos(char* line, char type) { int i; int c; char *name; char *s_qte; char *convert; int num; name = NULL; s_qte = NULL; convert = NULL; for (i = 0, c = 0; i < my_strlen(line) && line[i] != ';'; i++) { name = realloc(name, c...
Yunori/Fridge-menu
functions/my_putstr.c
void my_putchar(char c); void my_putstr(char *str) { int i; for (i = 0; str[i] != '\0'; i++) my_putchar(str[i]); }
Yunori/Fridge-menu
controller/ingredients.c
#include "../game.h" void add_ingredient(char *name, int num, int type) { long qte; s_ingredients* new = malloc(sizeof(s_ingredients)); int z; z = -1; if(type == '2') z = search_ingredient(name, num); if(z != -1) num = num + z; ingredient = delete_ingredient(ingredient, name); new->name = name...
Yunori/Fridge-menu
functions/my_getnbr.c
<filename>functions/my_getnbr.c<gh_stars>0 int my_getnbr(char *str) { int neg; int result; for (neg = 1; *str < '0' || *str > '9'; str++) neg = (*str == '-') ? -1 : 1; for (result = 0; *str >= '0' && *str <= '9'; ++str) result = (result * 10) + (*str - '0'); return (result * neg); }
Farhad-00009/SMS
school billing system.c
//LEARNPROGRAMO-PROGRAMMING MADE SIMPLE #include<stdio.h> #include<string.h> #include<stdlib.h> #include<conio.h> #include<windows.h> struct dat//for date(month and day { int d,m;//d=day,m=month }; int clscanf();//check class (1-12) struct student { struct dat dt; float f,fine,tot,adv,due;//f=...
BMSTU-IU8-15/algorithmic-languages-project-2
util/cli_util.h
<reponame>BMSTU-IU8-15/algorithmic-languages-project-2 #pragma once #include <iostream> using std::cout; using std::endl; namespace cli { void clear(); void print_logo(); void print_win_message(); void print_loose_message(); void print_player1_win_message(); void print_player2_win_messa...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/game_configuration.h
<filename>battleships/game_configuration.h<gh_stars>0 #pragma once #include <cstddef> #include <map> using std::map; namespace battleships { /** * @brief Configuration of a game */ struct GameConfiguration { /** * @brief Width of the field */ size_t field_width; ...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/container_util.h
<filename>battleships/container_util.h #pragma once #include <algorithm> #include <random> #include <set> #include <stdexcept> using std::find; using std::set; using std::advance; namespace common_util { template<typename T> inline bool contains(const set<T> &container, const T &value) { return find...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/simple_game_field.h
<reponame>BMSTU-IU8-15/algorithmic-languages-project-2<filename>battleships/simple_game_field.h #pragma once #include <string> #include "game_field.h" #include "game_configuration.h" #include "coordinate.h" #include "game_field_cell.h" using std::string; using std::to_string; namespace battleships { class Simp...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/game.h
#pragma once #include "game_field.h" namespace battleships { class Game : public ConsolePrintable { public: virtual ~Game() = default; [[nodiscard]] virtual GameConfiguration configuration() = 0; [[nodiscard]] virtual GameField *field_1() = 0; [[nodiscard]] virtual GameFie...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/game_field_cell.h
<reponame>BMSTU-IU8-15/algorithmic-languages-project-2<filename>battleships/game_field_cell.h #pragma once #include <set> #include <cstddef> #include <cstdint> #include <utility> #include "direction.h" #include "ship_position.h" using std::set; namespace battleships { class GameFieldCell { public: ...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/rival_bot.h
<reponame>BMSTU-IU8-15/algorithmic-languages-project-2 #pragma once #include "game_field.h" namespace battleships { /** * @brief Bot responsible for playing against the player */ class RivalBot { public: /** * @brief Callback notified on attacks performed by the bot ...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/game_field.h
<reponame>BMSTU-IU8-15/algorithmic-languages-project-2<filename>battleships/game_field.h #pragma once #include "console_printable.h" #include "coordinate.h" #include "game_configuration.h" #include <stdexcept> using std::out_of_range; using std::runtime_error; namespace battleships { class GameField : public Con...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/console_printable.h
#pragma once #include <iostream> using std::cout; using std::endl; namespace battleships { class ConsolePrintable { public: virtual void print_to_console() const noexcept = 0; }; }
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/simple_rival_bot.h
#pragma once #include <random> #include <set> #include <optional> #include "rival_bot.h" #include "direction.h" #include "ship_position.h" using std::default_random_engine; using std::random_device; using std::bernoulli_distribution; using std::uniform_int_distribution; using std::optional; using std::set; namespac...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/coordinate.h
#pragma once #include <cstddef> #include <string> #include "direction.h" using std::string; namespace battleships { struct Coordinate { /* signed type is used to allow negative number comparisons */ int x, y; inline Coordinate(const int &x, const int &y) : x(x), y(y) {} void mo...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/simple_game.h
<filename>battleships/simple_game.h #pragma once #include "game.h" #include "simple_game_field.h" namespace battleships { class SimpleGame : public Game { const GameConfiguration configuration_; GameField *field_1_, *field_2_; public: explicit SimpleGame(const GameConfiguration &con...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/ship_position.h
#pragma once #include <random> #include <stdexcept> using std::random_device; using std::bernoulli_distribution; using std::invalid_argument; using std::runtime_error; namespace battleships { static bernoulli_distribution ship_position_bool_distribution; // NOLINT(cert-err58-cpp) enum ShipPosition { ...
BMSTU-IU8-15/algorithmic-languages-project-2
battleships/direction.h
<gh_stars>0 #pragma once #include <random> #include <stdexcept> #include <string> using std::random_device; using std::string; using std::uniform_int_distribution; using std::invalid_argument; using std::runtime_error; namespace battleships { static uniform_int_distribution<int8_t> direction_int_distribution(0,...
d3r0/gorgbmatrix
vendor/rpi-rgb-led-matrix/lib/multiplex-transformers-internal.h
<reponame>d3r0/gorgbmatrix // -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- // Copyright (C) 2017 <NAME> <<EMAIL>> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation version 2. ...
luweiguo511/TimerEM2Mode
main.c
/**************************************************************************//** * @main_series0.c * @brief This project demonstrates frequency generation using the * TIMER module. The pin specified in readme.txt is configured for output * compare and toggles on each overflow event at a set frequency. * @version 0....
teemid/Capstan
include/Capstan/Containers/DynamicArray.h
#ifndef CAPSTAN_CONTAINERS_DYNAMIC_ARRAY_H #define CAPSTAN_CONTAINERS_DYNAMIC_ARRAY_H #include "Platform/Memory.h" #define Increment(variable) (variable) += 1 #define Decrement(variable) (variable) -= 1 namespace Capstan { #define DEFAULT_INITIAL_SIZE 24 template<typename T> class DynamicArray { ...
teemid/Capstan
include/Capstan/Platform/Win32/PlatformData.h
<reponame>teemid/Capstan<gh_stars>0 #ifndef CAPSTAN_PLATFORM_WIN32_PLATFORM_DATA_H #define CAPSTAN_PLATFORM_WIN32_PLATFORM_DATA_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <Windows.h> #include <WinGDI.h> namespace Capstan { namespace Platform { struct PlatformData ...
teemid/Capstan
include/Capstan/ECS/Components/BoxCollider2D.h
#ifndef CAPSTAN_ECS_COMPONENTS_BOX_COLLIDER_2D_H #define CAPSTAN_ECS_COMPONENTS_BOX_COLLIDER_2D_H #include "Capstan/ECS/Components/Collider2D.h" #include "Capstan/Math/Vector2f.h" namespace Capstan { namespace ECS { struct BoxCollider2D : Collider2D { Vector2f lower; Vector2f upper; }; }...
teemid/Capstan
include/Capstan/ECS/Components/SpriteRenderer.h
#ifndef CAPSTAN_ECS_SPRITE_RENDERER_COMPONENT_H #define CAPSTAN_ECS_SPRITE_RENDERER_COMPONENT_H // #include "ECS/Components/Component.h" namespace Capstan { namespace ECS { struct SpriteRendererComponent { Sprite * sprite; Vector2f coordinates; }; } } #endif
teemid/Capstan
include/Capstan/AssetManager.h
<gh_stars>0 #ifndef CAPSTAN_ASSET_MANAGER_H #define CAPSTAN_ASSET_MANAGER_H #include "Capstan/Types.h" namespace Capstan { #define MAX_ASSET_COUNT 200 typedef UInt32 AssetId; enum class AssetType : UInt32 { BITMAP, SOUND, MUSIC, SHADER }; enum class AssetStatus ...
teemid/Capstan
include/Capstan/Platform/OpenGLContext.h
#ifndef CAPSTAN_PLATFORM_OPENGL_CONTEXT_H #define CAPSTAN_PLATFORM_OPENGL_CONTEXT_H #include "Capstan/Types.h" namespace Capstan { namespace Platform { struct PlatformData; namespace OpenGL { Bool32 CreateContext (PlatformData * data, Int32 major_version, Int32 minor_version); Bool32 Del...
teemid/Capstan
include/Capstan/Common.h
<filename>include/Capstan/Common.h<gh_stars>0 #ifndef CAPSTAN_COMMON_H #define CAPSTAN_COMMON_H #include "Capstan/Types.h" #define local_persist static #define internal static #define ILLEGAL_CASE(message, ...) \ default: \ { \ Assert(false, message, __VA_ARGS__); \ } break #endif
teemid/Capstan
include/Capstan/Allocators/BitmappedAllocator.h
#ifndef CAPSTAN_ALLOCATORS_BITMAPPED_BLOCK_H #define CAPSTAN_ALLOCATORS_BITMAPPED_BLOCK_H namespace Capstan { class BitmappedAllocator { public: BitmappedAllocator (size_t size, size_t blockSize); ~BitmappedAllocator (void); void * Allocate (size_t size); void Deallocate (...
teemid/Capstan
include/Capstan/ECS/Systems/System.h
<reponame>teemid/Capstan<filename>include/Capstan/ECS/Systems/System.h #ifndef CAPSTAN_ECS_SYSTEM_H #define CAPSTAN_ECS_SYSTEM_H #include "Capstan/Common.h" namespace Capstan { namespace ECS { class System { public: virtual void Update (Real64 deltaTime) = 0; }; } } #endif
teemid/Capstan
include/Capstan/Allocators/PoolAllocator.h
<gh_stars>0 #ifndef CAPSTAN_ALLOCATORS_POOLALLOCATOR_H #define CAPSTAN_ALLOCATORS_POOLALLOCATOR_H namespace Capstan { template <typename T> class PoolAllocator { public: PoolAllocator (size_t size); ~PoolAllocator (void); void * Allocate (); void Free (void * memory); ...
teemid/Capstan
include/Capstan/ECS/Systems/Physics2DSystem.h
#ifndef CAPSTAN_PHYSICS_2D_SYSTEM_H #define CAPSTAN_PHYSICS_2D_SYSTEM_H #include "Capstan/ECS/Systems/System.h" #include "Capstan/ECS/Components/Collider2D.h" #include "Capstan/ECS/Components/BoxCollider2D.h" #include "Capstan/ECS/Components/CircleCollider2D.h" namespace Capstan { namespace ECS { class Physics2...
teemid/Capstan
include/Capstan/Platform/FileSystem.h
<filename>include/Capstan/Platform/FileSystem.h #ifndef CAPSTAN_FILESYSTEM_H #define CAPSTAN_FILESYSTEM_H #include "Capstan/Types.h" namespace Capstan { class FileSystem { public: FileSystem (void); ~FileSystem (void); void StartUp (void); void ShutDown (void); ...
teemid/Capstan
include/Capstan/Allocators/StackAllocator.h
<gh_stars>0 #ifndef CAPSTAN_MEMORY_STACK_ALLOCATOR_H #define CAPSTAN_MEMORY_STACK_ALLOCATOR_H #include "Capstan/Types.h" namespace Capstan { typedef UInt32 StackMarker; struct StackAllocation { void * memory; StackMarker marker; }; class StackAllocator { public: ...
teemid/Capstan
include/Capstan/Graphics/Camera.h
#ifndef CAPSTAN_GRAPHICS_CAMERA_H #define CAPSTAN_GRAPHICS_CAMERA_H #include "Capstan/Math/Vector3f.h" namespace Capstan { namespace Graphics { class Camera { public: Camera (void); Camera (Vector3f position, Vector3f direction); ~Camera (void); void LookAt (Vector3f tar...
teemid/Capstan
include/Capstan/Math/Color.h
<gh_stars>0 #ifndef CAPSTAN_COLOR_H #define CAPSTAN_COLOR_H namespace Capstan { struct Color3f { union { Real32 data[3]; struct { Real32 r; Real32 g; Real32 b; }; }; }; inline Lerp ...
teemid/Capstan
include/Capstan/Allocators/DoubleStackAllocator.h
<filename>include/Capstan/Allocators/DoubleStackAllocator.h<gh_stars>0 #ifndef CAPSTAN_ALLOCATORS_DOUBLE_STACK #define CAPSTAN_ALLOCATORS_DOUBLE_STACK #include "Capstan/Allocators/StackAllocator.h" namespace Capstan { class DoubleStackAllocator { public: DoubleStackAllocator (size_t size); ...
teemid/Capstan
include/Capstan/Math/Vector2f.h
#ifndef CAPSTAN_MATH_VECTOR2F_H #define CAPSTAN_MATH_VECTOR2F_H #include "Capstan/Platform/Intrinsics.h" #include "Capstan/Types.h" namespace Capstan { struct Vector2f { union { Real32 data[2]; struct { Real32 x, y; }; struct { Real32 u, v; }; }; V...
teemid/Capstan
include/Capstan/Math/Arithmetic.h
<gh_stars>0 #ifndef CAPSTAN_MATH_COMMON_H #define CAPSTAN_MATH_COMMON_H #include "Capstan/Common.h" namespace Capstan { namespace Math { inline UInt8 Abs (Int8 i) { return (i < 0) ? (-1) * i : i; } inline UInt16 Abs (Int16 i) { return (i < 0) ? (-1) * i : i; } inline UI...
teemid/Capstan
include/Capstan/Math/Vector3f.h
#ifndef CAPSTAN_MATH_VECTOR3F_H #define CAPSTAN_MATH_VECTOR3F_H #include "Capstan/Types.h" #include "Capstan/Platform/Intrinsics.h" #include "Capstan/Math/Vector2f.h" namespace Capstan { struct Vector3f { union { Real32 data[3]; struct { Real32 x, y, z; }; struct ...
teemid/Capstan
include/Capstan/Math/Constants.h
<filename>include/Capstan/Math/Constants.h #ifndef CAPSTAN_MATH_CONSTANTS_H #define CAPSTAN_MATH_CONSTANTS_H #include "Capstan/Types.h" namespace Capstan { namespace Math { #define TWO_PI 6.28318530718f #define PI 3.14159265359f #define PI_2 1.57079632679f #define PI_3 1.0471975512f #defi...
teemid/Capstan
include/Capstan/ECS/Systems/SpriteRenderer.h
#ifndef CAPSTAN_ECS_SPRITE_RENDERER_SYSTEM_H #define CAPSTAN_ECS_SPRITE_RENDERER_SYSTEM_H #include "ECS/Systems/System.h" namespace Capstan { namespace ECS { class SpriteRendererSystem : public System { public: void Update (Real64 deltaTime); private: SpriteRendererComponent }; }...
teemid/Capstan
include/Capstan/Physics/2D/AABB.h
<filename>include/Capstan/Physics/2D/AABB.h<gh_stars>0 #ifndef CAPSTAN_PHYSICS_2D_AABB #define CAPSTAN_PHYSICS_2D_AABB #include "Capstan/Math/Vector2f.h" #include "Capstan/Types.h" namespace Capstan { namespace Physics { struct AABB { Vector2f lower; Vector2f upper; }; Bool32 Collis...
teemid/Capstan
include/Capstan/Platform/Threading.h
<filename>include/Capstan/Platform/Threading.h #ifndef CAPSTAN_PLATFORM_THREADING_H #define CAPSTAN_PLATFORM_THREADING_H namespace Capstan { } #endif
teemid/Capstan
include/Capstan/Containers/HashMap.h
<reponame>teemid/Capstan #ifndef CAPSTAN_CONTAINERS_HASHMAP_H #define CAPSTAN_CONTAINERS_HASHMAP_H #include "Platform/Types.h" #define Increment(variable) (variable) += 1 #define Decrement(variable) (variable) -= 1 #define DEFAULT_BUCKET_COUNT 11 #define DEFAULT_BUCKET_LENGTH 4 namespace Capstan { typedef UI...
teemid/Capstan
include/Capstan/ECS/Entity.h
#ifndef CAPSTAN_ECS_ENTITY_H #define CAPSTAN_ECS_ENTITY_H #include "Platform/Types.h" namespace Capstan { namespace ECS { typedef UInt32 Entity; } } #endif
teemid/Capstan
include/Capstan/Math/Vector4f.h
<gh_stars>0 #ifndef CAPSTAN_MATH_VECTOR4F_H #define CAPSTAN_MATH_VECTOR4F_H #include "Capstan/Platform/Memory.h" #include "Capstan/Platform/Intrinsics.h" namespace Capstan { struct Vector4f { union { Real32 data[4]; struct { Real32 x, y, z, w; }; struct { Real32 r,...
teemid/Capstan
include/Capstan/EventManager.h
#ifndef ENGINE_EVENTMANAGER_H #define ENGINE_EVENTMANAGER_H namespace Capstan { struct Event { void * message; }; class EventManager { public: EventManager (); ~EventManager (); void StartUp (void); void ShutDown (void); private: Event * q...
teemid/Capstan
include/Capstan/Platform/Win32/Debug.h
<reponame>teemid/Capstan #ifndef CAPSTAN_WIN32_DEBUG_H #define CAPSTAN_WIN32_DEBUG_H namespace Capstan { namespace Debug { void Win32HandleError (void); } } #endif
teemid/Capstan
include/Capstan/Graphics/OpenGL/Texture.h
#ifndef CAPSTAN_GRAPHICS_OPENGL_TEXTURE_H #define CAPSTAN_GRAPHICS_OPENGL_TEXTURE_H namespace Capstan { namespace Graphics { class Texture { public: enum class WrapMode { WRAP_CLAMP, WRAP_CLAMP_ZERO, WRAP_REPEAT, WRAP_MIRRORED_REPEAT, ...
teemid/Capstan
include/Capstan/HashFunctions.h
<filename>include/Capstan/HashFunctions.h #ifndef CAPSTAN_HASH_H #define CAPSTAN_HASH_H #include "Capstan/Types.h" namespace Capstan { Hash MultiplicativeHashFunction (UInt8 * bytes, UInt32 length) { Hash hash = 0; for (UInt32 i = 0; i < length; ++i) { hash = ((hash * 31)...
teemid/Capstan
include/Capstan/Math/Quaternion.h
<filename>include/Capstan/Math/Quaternion.h #ifndef CAPSTAN_MATH_QUATERNION_H #define CAPSTAN_MATH_QUATERNION_H #include "Math/Vector.h" namespace Capstan { struct Quaternion { union { Real32 data[3]; struct { Real32 i; Real3...
teemid/Capstan
include/Capstan/Math/Matrix4f.h
<reponame>teemid/Capstan #ifndef CAPSTAN_MATH_MATRIX4F_H #define CAPSTAN_MATH_MATRIX4F_H #include "Capstan/Platform/Intrinsics.h" #include "Capstan/Platform/Memory.h" #include "Capstan/Types.h" #include "Capstan/Math/Constants.h" #include "Capstan/Math/Vector3f.h" #include "Capstan/Math/Vector4f.h" namespace Capsta...
teemid/Capstan
include/Capstan/Physics/2D/2DPhysics.h
<gh_stars>0 #ifndef CAPSTAN_PHYSICS_2D #define CAPSTAN_PHYSICS_2D #include "Physics/2D/AABB.h" #endif
teemid/Capstan
include/Capstan/Graphics/OpenGL/Shader.h
<reponame>teemid/Capstan #ifndef CAPSTAN_GRAPHICS_OPENGL_SHADER_H #define CAPSTAN_GRAPHICS_OPENGL_SHADER_H #include "Capstan/Common.h" #include "Capstan/Graphics/OpenGL/OpenGL.h" namespace Capstan { namespace Graphics { enum class ShaderStage { Vertex, Fragment }; enum class Uniform...
teemid/Capstan
include/Capstan/ECS/EntityManager.h
<gh_stars>0 #ifndef CAPSTAN_ENTITY_MANAGER_H #define CAPSTAN_ENTITY_MANAGER_H #include "Capstan/Common.h" namespace Capstan { namespace ECS { typedef UInt32 Entity; class Capstan { public: Component * GetComponent (Entity entity, ComponentType type); void AddComponent (Entity entity...
teemid/Capstan
include/Capstan/Platform/Gamepad.h
<gh_stars>0 #ifndef CAPSTAN_GAMEPAD_H #define CAPSTAN_GAMEPAD_H #include "Capstan/Types.h" namespace Capstan { struct Stick { Real32 x; Real32 y; }; struct GamePadState { Stick leftStick; Stick rightStick; union { struct {...
teemid/Capstan
include/Capstan/Graphics/RenderManager.h
<reponame>teemid/Capstan #ifndef CAPSTAN_GRAPHICS_RENDER_MANAGER_H #define CAPSTAN_GRAPHICS_RENDER_MANAGER_H #include "Capstan/Graphics/Renderer.h" namespace Capstan { namespace Graphics { class RenderManager { public: RenderManager (void); ~RenderManager (void); void StartUp (v...
teemid/Capstan
include/Capstan/Platform/Clock.h
<gh_stars>0 #ifndef CAPSTAN_CLOCK_H #define CAPSTAN_CLOCK_H #include "Capstan/Types.h" namespace Capstan { namespace Platform { Real64 GetPeriod (void); Real64 GetTime (void); } } #endif
teemid/Capstan
include/Capstan/Platform/Assert.h
#ifndef CAPSTAN_ASSERT_H #define CAPSTAN_ASSERT_H #ifdef _WIN32 #include <intrin.h> #define HALT() __debugbreak() #else #define HALT() __asm { int 3 } #endif END #ifdef _WIN32 #ifdef CAPSTAN_ASSERT namespace Capstan { void ReportAssertFailure (char * msg, char * filename, int linenumber); } #include <cst...
teemid/Capstan
include/Capstan/BitmapFile.h
<gh_stars>0 #ifndef CAPSTAN_BITMAP_H #define CAPSTAN_BITMAP_H #include "Capstan/Types.h" namespace Capstan { enum class Compression : UInt32 { RGB = 0x1, BITFIELDS = 0x3 }; #pragma pack(push, 1) struct BitmapCoreHeader { char signature[2]; Int32 fileSize; ...
teemid/Capstan
include/Capstan/Math/Trigonometric.h
#ifndef CAPSTAN_MATH_TRIGONOMETRIC_H #define CAPSTAN_MATH_TRIGONOMETRIC_H #include "Math/Constants.h" #include "Platform/Types.h" namespace Capstan { namespace Math { inline Real32 ToRadians (Real32 degrees) { return (degrees / 360.0f) * TWO_PI; } inline Real32 ToDegrees (Real32 radians) ...
teemid/Capstan
include/Capstan/Platform/Intrinsics.h
#ifndef CAPSTAN_PLATFORM_INTRINSICS #define CAPSTAN_PLATFORM_INTRINSICS #if defined(_MSC_VER) #include <intrin.h> #endif #include <cmath> #include "Capstan/Types.h" namespace Capstan { inline Real32 Sin (Real32 angle) { return sinf(angle); } inline Real32 Cos (Real32 angle) { re...
teemid/Capstan
include/Capstan/Types.h
<reponame>teemid/Capstan #ifndef CAPSTAN_TYPES_H #define CAPSTAN_TYPES_H #include <cstdint> typedef uint8_t Byte; typedef uint8_t UInt8; typedef uint16_t UInt16; typedef uint32_t UInt32; typedef uint64_t UInt64; typedef int8_t Int8; typedef int16_t Int16; typedef int32_t Int32; typedef int64_t Int64; typede...
teemid/Capstan
include/Capstan/Utils.h
#ifndef CAPSTAN_UTILS_H #define CAPSTAN_UTILS_H namespace Capstan { #define ArrayLength(array) sizeof(array) / sizeof(array[0]) #define internal static #define global extern #define KB(size) ((size) * 1024L) #define MB(size) (KB(size) * 1024L) #define GB(size) (MB(size) * 1024L) } #endif
teemid/Capstan
include/Capstan/Graphics/Renderer.h
#ifndef CAPSTAN_GRAPHICS_RENDERER_H #define CAPSTAN_GRAPHICS_RENDERER_H namespace Capstan { class Renderer { public: virtual void StartUp (void) = 0; virtual void ShutDown (void) = 0; virtual void Render (void) = 0; }; } #endif
teemid/Capstan
include/Capstan/Sound/SoundManager.h
#ifndef CAPSTAN_SOUNDMANAGER_H #define CAPSTAN_SOUNDMANAGER_H namespace Capstan { class SoundManager { public: SoundManager (void); ~SoundManager (void); void StartUp (void); void ShutDown (void); }; } #endif
teemid/Capstan
include/Capstan/Graphics/Software/SoftwareRenderer.h
#ifndef CAPSTAN_GRAPHICS_SOFTWARE_H #define CAPSTAN_GRAPHICS_SOFTWARE_H #include "Capstan/Graphics/Renderer.h" namespace Capstan { namespace Graphics { class SoftwareRenderer : public Capstan::Renderer { public: SoftwareRenderer (void); ~SoftwareRenderer (void); void StartUp (vo...
teemid/Capstan
include/Capstan/ECS/Components/CircleCollider2D.h
<gh_stars>0 #ifndef CAPSTAN_CIRCLE_COLLIDER_2D_H #define CAPSTAN_CIRCLE_COLLIDER_2D_H #include "Capstan/ECS/Components/Collider2D.h" #include "Capstan/Math/Vector2f.h" #include "Capstan/Common.h" namespace Capstan { namespace ECS { struct CircleCollider2D : Collider2D { Vector2f center; Real3...
teemid/Capstan
include/Capstan/MemoryManager.h
<reponame>teemid/Capstan #ifndef CAPSTAN_MEMORY_MANAGER_H #define CAPSTAN_MEMORY_MANAGER_H #include "Capstan/Types.h" namespace Capstan { enum class ManagerType { StackAllocator, DoubleStackAllocator, PoolAllocator }; class MemoryManager { public: MemoryManage...
teemid/Capstan
include/Capstan/Globals.h
<gh_stars>0 #ifndef CAPSTAN_GLOBALS_H #define CAPSTAN_GLOBALS_H #include "Capstan/AssetManager.h" #include "Capstan/InputManager.h" #include "Capstan/MemoryManager.h" #include "Capstan/Timer.h" #include "Capstan/Graphics/RenderManager.h" #include "Capstan/Platform/FileSystem.h" namespace Capstan { namespace Plat...
teemid/Capstan
include/Capstan/Timer.h
<reponame>teemid/Capstan #ifndef CAPSTAN_TIMER_H #define CAPSTAN_TIMER_H #include "Capstan/Types.h" namespace Capstan { class Timer { public: Timer (void); ~Timer (void); void StartUp (void); void ShutDown (void); void Step (void); Real64 GetDelta (void)...
teemid/Capstan
include/Capstan/Strings.h
<reponame>teemid/Capstan #ifndef CAPSTAN_STRINGS_H #define CAPSTAN_STRINGS_H #include "Capstan/Types.h" namespace Capstan { namespace String { Bool32 Compare (const char * s1, const char * s2); Bool32 Compare (const char * s1, const char * s2, UInt32 lenght = 0); Bool32 Find (const char * string, const...
teemid/Capstan
include/Capstan/Graphics/OpenGL/OpenGL.h
#ifndef CAPSTAN_GRAPHICS_OPENGL_H #define CAPSTAN_GRAPHICS_OPENGL_H #include "gl/glcorearb.h" #include "Capstan/Graphics/Renderer.h" #define CAPSTAN_GL(type, name) extern type name; #include "Capstan/Graphics/OpenGL/Functions.def" namespace Capstan { namespace Graphics { class Shader; class OpenGL : publi...
teemid/Capstan
include/Capstan/Platform/Memory.h
#ifndef CAPSTAN_PLATFORM_MEMORY_H #define CAPSTAN_PLATFORM_MEMORY_H #include "Capstan/Types.h" namespace Capstan { namespace Memory { void * Allocate(Size size); void * Reallocate(void * memory, Size prevSize, Size newSize); void Copy (void * source, void * destination, Size size); void Zero (void *...
teemid/Capstan
include/Capstan/ECS/Components.h
<reponame>teemid/Capstan<gh_stars>0 #ifndef CAPSTAN_ECS_COMPONENTS_H #define CAPSTAN_ECS_COMPONENTS_H namespace Capstan { namespace ECS { enum class ComponentType { BoxCollider2D, Sprite }; } } #endif
teemid/Capstan
include/Capstan/InputManager.h
<reponame>teemid/Capstan #ifndef CAPSTAN_INPUT_MANAGER_H #define CAPSTAN_INPUT_MANAGER_H namespace Capstan { class InputManager { public: InputManager (void); ~InputManager (void); void StartUp (void); void ShutDown (void); }; } #endif
teemid/Capstan
include/Capstan/ECS/Components/Collider2D.h
<reponame>teemid/Capstan #ifndef CAPSTAN_ECS_COMPONENT_COLLIDER_2D_H #define CAPSTAN_ECS_COMPONENT_COLLIDER_2D_H namespace Capstan { namespace ECS { namespace Collider2DType { Box, Circle }; struct Collider2D { Collider2DType type; }; } } #endif
teemid/Capstan
include/Capstan/Platform/Debug.h
<gh_stars>0 #ifndef CAPSTAN_DEBUG_H #define CAPSTAN_DEBUG_H #include <cstdio> namespace Capstan { namespace Debug { #ifdef CAPSTAN_DEBUG void Print (char * formattedString, ...); #endif } } #endif
FPGA-Research-Manchester/nextpnr-fabulous
fabulous/arch.h
/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. ...
FPGA-Research-Manchester/nextpnr-fabulous
xc7/cells.h
/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018 <NAME> <<EMAIL>> * Copyright (C) 2018 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this ...
FPGA-Research-Manchester/nextpnr-fabulous
xc7/gfx.h
/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. ...