repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
aiuno/WingOS
libs/utils/sys/raw_msg_system.h
<reponame>aiuno/WingOS #ifndef RAW_MSG_SYSTEM_H #define RAW_MSG_SYSTEM_H #include <stddef.h> #include <stdint.h> struct raw_msg_request { bool valid; size_t size; uint8_t *data; } __attribute__((packed)); struct raw_msg_call_request { uint64_t argument[5]; uint64_t return_value; }; #endif // RAW_M...
aiuno/WingOS
unit-test/src/smart_ptr_check.h
<filename>unit-test/src/smart_ptr_check.h #pragma once int unique_ptr_create_destroy_check(); int unique_ptr_raw_check(); int unique_ptr_operator_check(); int unique_ptr_reset_check(); int unique_ptr_release_check(); int make_unique_check();
aiuno/WingOS
libs/utils/no_null.h
#ifndef NO_NULL_H #define NO_NULL_H #include <assert.h> #include <stddef.h> #include <utils/type/is_same.h> namespace utils { template <typename T> class no_null { T _value; public: static_assert(!is_same<nullptr_t, T>::value, "no null must not be null"); template <typename T2>...
aiuno/WingOS
unit-test/src/type_trait_check.h
<gh_stars>100-1000 #pragma once int integral_constant_check(); int integral_constant_false_check(); int integral_constant_true_check(); int is_same_check_true(); int is_same_check_false(); int remove_reference_check(); int remove_const_check(); int remove_volatile_check(); int remove_pointer_check(); int is_const_c...
aiuno/WingOS
libs/utils/lock.h
#ifndef LOCK_H #define LOCK_H #include <stddef.h> #include <stdint.h> namespace utils { enum lock_state { LOCK_LOCKED = true, LOCK_FREE = false, }; class lock_type { bool raw; public: lock_type() : raw(LOCK_FREE){}; // by default the lock is free bool i...
aiuno/WingOS
libs/utils/math.h
#ifndef MATH_H #define MATH_H namespace utils { template <class A> constexpr A max(const A a, const A b) { if (a > b) { return a; } else { return b; } } template <class A> constexpr A min(const A a, const A b) { ...
aiuno/WingOS
kernel/arch/x86_64/device/local_data.h
<reponame>aiuno/WingOS #pragma once #include <64bit.h> #include <arch.h> #include <backtrace.h> #include <device/apic.h> #include <gdt.h> #include <interrupt.h> #include <mem/virtual.h> #include <proc/process.h> #include <smp.h> #include <stdint.h> class page_table; static const uint32_t stack_size = STACK_SIZE; class ...
aiuno/WingOS
kernel/arch/x86_64/device/graphic.h
<reponame>aiuno/WingOS #pragma once #include <device/general_device.h> enum framebuff_bpp { BPP_24_BIT = 2, BPP_32_BIT = 3, }; class basic_framebuffer_graphic_device : public generic_framebuffer { protected: size_t _width; size_t _height; void *_addr; public: basic_framebuffer_graphic_device(...
aiuno/WingOS
libs/utils/memory/memory.h
<reponame>aiuno/WingOS #ifndef MEMORY_H #define MEMORY_H #include <assert.h> #include <stddef.h> #include <string.h> namespace utils { /* NOTE: this is for replacing c function argument * void f(void* data, size_t size); * with: * void f(utils::memory mem); * * it's like a unique_ptr, but...
aiuno/WingOS
unit-test/src/vector_check.h
#pragma once int wvector_create_check(); int wvector_capacity_check(); int wvector_push_back_check(); int wvector_get_check(); int wvector_remove_check(); int wvector_clear_check();
aiuno/WingOS
libs/gui/widget.h
#pragma once #include <gui/graphic_system.h> #include <stddef.h> #include <utils/container/wvector.h> namespace gui { class widget { protected: int64_t widget_width; int64_t widget_height; int64_t widget_x; int64_t widget_y; bool widget_should_draw = true; bo...
aiuno/WingOS
kernel/generic/kernel.h
#pragma once #include <device/debug/com.h> #include <stdint.h> #include <stivale_struct.h> void _start(struct stivale_struct *bootloader_data);
aiuno/WingOS
kernel/generic/programm_launcher.h
#pragma once #include <elf_gnu_structure.h> #include <filesystem/echfs.h> // to do add a global file system #include <sys/types.h> #include <utils/sys/programm_exec_info.h> pid_t launch_programm(const char *path, file_system *file_sys, int argc, const char **argv); pid_t launch_programm_usr(programm_exec_info *info); ...
aiuno/WingOS
libs/libc/unistd.h
#ifndef UNISTD_H #define UNISTD_H #include <stdint.h> #include <time.h> // FIXME: move it in sys/types.h typedef long suseconds_t; unsigned int sleep(unsigned int sec); suseconds_t usleep(suseconds_t sec); #endif // UNISTD_H
aiuno/WingOS
kernel/generic/device/general_device.h
#ifndef GENERAL_DEVICE_H #define GENERAL_DEVICE_H #include <module/device_generic_driver.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <utils/container/wvector.h> #include <utils/sys/device_file_info.h> #define MAX_DEVICE 128 extern const char *device_type_to_str[]; class general_device; voi...
aiuno/WingOS
kernel/generic/logging.h
#ifndef LOGGING_H #define LOGGING_H #include <device/debug/com.h> #include <device/general_device.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <utility.h> #include <utils/lock.h> enum log_state { LOG_INFO = 0, LOG_DEBUG = 1, LOG_ERROR = 2, LOG_FATAL = 3, ...
aiuno/WingOS
libs/utils/type/is_same.h
#ifndef IS_SAME_H #define IS_SAME_H #include <utils/type/integral_constant.h> #include <utils/type_traits.h> namespace utils { template <class T1, class T2> class is_same : public false_type { }; template <class T1> class is_same<T1, T1> : public true_type { }; } // namespace utils #en...
aiuno/WingOS
kernel/arch/x86_64/device/time/rtc.h
#ifndef RTC_H #define RTC_H #include <stdint.h> class RTC { public: void init() const; // wait a const init function ? is this legal ? uint8_t read(int reg) const; uint8_t get_sec() const; uint8_t get_min() const; uint8_t get_hour() const; uint8_t get_day() const; uint8_t get_month() const...
aiuno/WingOS
kernel/generic/backtrace.h
<filename>kernel/generic/backtrace.h #ifndef BACKTRACE_H #define BACKTRACE_H #include <arch.h> class backtrace { static const int backtrace_max_entry_count = 32; backtrace_entry_type entry[backtrace_max_entry_count]; public: backtrace(); void add_entry(const backtrace_entry_type added_entry); void...
aiuno/WingOS
libs/utils/sys/syscall_codes.h
#pragma once enum class syscall_codes { NULL_SYSCALL = 0, // don't use >:^( SET_MODULES_CALLS = 1, // each module has a call table, it's like syscall but directly link with the kernel, this syscall is reserved to modules, with the modules call table you can do specific low level operation, this syscall can be...
aiuno/WingOS
libs/utils/sys/device_file_info.h
<gh_stars>100-1000 #ifndef DEVICE_FILE_INFO_H #define DEVICE_FILE_INFO_H #include <stdint.h> #define MOUSE_FILE_BUFFER "/dev/mouse" #define KEYBOARD_FILE_BUFFER "/dev/keyboard" #define FRAMEBUFFER_FILE_BUFFER "/dev/framebuffer" struct mouse_buff_info { int32_t mouse_x; int32_t mouse_y; bool left; bool...
aiuno/WingOS
libs/kern/process_buffer.h
<reponame>aiuno/WingOS #pragma once #include <stdint.h> namespace sys { } // namespace sys
aiuno/WingOS
libs/gui/widget/button.h
#pragma once #include <gui/window.h> namespace gui { class button_widget : public widget { const char *button_title; bool is_hovered; uint64_t text_length = 0; gui::window *parent; bool start_click = false; uint64_t clicked = 0; void (*click)(uint64_t cl...
aiuno/WingOS
unit-test/src/array_check.h
#pragma once int array_creation_check(); int array_access_check(); int array_fill_check();
aiuno/WingOS
libs/module/module_calls.h
<gh_stars>100-1000 #ifndef MODULE_CALLS_H #define MODULE_CALLS_H #include <module/device_generic_driver.h> #include <stddef.h> #include <stdint.h> template <typename T, typename... argument> using mfunc = T (*)(argument...); #define IO_BIT_SIZE_8 0b0 #define IO_BIT_SIZE_16 0b01 #define IO_BIT_SIZE_32 0b10 #define IO_BI...
picardb/QtRemoteTestClient
src/model/network/Network.h
#pragma once #include <QObject> #include <QTcpSocket> #include "DnsServiceBrowser.h" #include "DnsServiceResolver.h" #include "Request.h" class Network : public QObject { Q_OBJECT private: DnsServiceBrowser m_dnsBrowser; DnsServiceResolver m_dnsResolver; QTcpSocket m_tcpSocket; QHostAddress ...
picardb/QtRemoteTestClient
src/model/network/DnsServiceRecordList.h
#pragma once #include <QAbstractTableModel> #include "DnsServiceRecord.h" class DnsServiceRecordList : public QAbstractTableModel { private: QVector<DnsServiceRecord> m_list; public: DnsServiceRecordList(QObject *parent = Q_NULLPTR); int rowCount(const QModelIndex & = QModelIndex()) const; int col...
picardb/QtRemoteTestClient
src/model/network/Request.h
<filename>src/model/network/Request.h #pragma once #include <QByteArray> struct Request { unsigned char system; unsigned char command; unsigned int length; QByteArray data; };
picardb/QtRemoteTestClient
src/model/network/DnsServiceBrowser.h
<reponame>picardb/QtRemoteTestClient<gh_stars>0 #pragma once #include <QObject> #include <QVector> #include <QSocketNotifier> #include "dns_sd.h" #include "DnsServiceRecordList.h" class DnsServiceBrowser : public QObject { Q_OBJECT private: DnsServiceRecordList m_recordList; DNSServiceRef m_serviceRef; ...
picardb/QtRemoteTestClient
src/widgets/MainWindow.h
<reponame>picardb/QtRemoteTestClient<filename>src/widgets/MainWindow.h #pragma once #include <QMainWindow> #include "MainWidget.h" class MainWindow : public QMainWindow { Q_OBJECT private: MainWidget *m_pCentralWidget; public: MainWindow(QWidget *parent = 0); ~MainWindow(); };
picardb/QtRemoteTestClient
src/widgets/MainWidget.h
#pragma once #include <QWidget> #include <QHostInfo> class MainWidget : public QWidget { Q_OBJECT public: MainWidget(QWidget *parent = 0); private slots: void onNetworkError(const QString& msg); };
picardb/QtRemoteTestClient
src/model/network/DnsServiceRecord.h
#pragma once #include <QString> class DnsServiceRecord { private: QString m_name; QString m_type; QString m_domain; quint32 m_interfaceIndex; public: enum membersIndexes { MEMBER_INDEX_NAME = 0, MEMBER_INDEX_TYPE = 1, MEMBER_INDEX_DOMAIN = 2, MEMBER_INDEX_INTERFACE = 3 ...
picardb/QtRemoteTestClient
src/constants.h
#pragma once #include <QString> const QString DNS_SD_REG_TYPE = "_qtremote._tcp";
picardb/QtRemoteTestClient
src/model/control/Control.h
#pragma once #include <QObject> #include "AudioControl.h" class Control : public QObject { Q_OBJECT private: AudioControl m_audio; public: Control(QObject *parent = 0); void audioRaiseVolume(unsigned char percentage) { m_audio.raiseVolume(percentage); } void audioLowerVolume(unsigned char perce...
picardb/QtRemoteTestClient
src/model/Model.h
<gh_stars>0 #pragma once #include <QObject> #include "network/Network.h" #include "control/Control.h" class Model : public QObject { Q_OBJECT private: static Network m_network; static Control m_control; public: static Network& network() { return m_network; } static Control& control() { return m_co...
picardb/QtRemoteTestClient
src/model/network/DnsServiceResolver.h
<filename>src/model/network/DnsServiceResolver.h #pragma once #include <QObject> #include <QSocketNotifier> #include <QHostInfo> #include "DnsServiceRecord.h" #include "dns_sd.h" class DnsServiceResolver : public QObject { Q_OBJECT private: DNSServiceRef m_ref; int m_port; static void ...
picardb/QtRemoteTestClient
src/model/control/AudioControl.h
<reponame>picardb/QtRemoteTestClient #pragma once class AudioControl { private: static const unsigned char SYSTEM_ID = 0x01; static const unsigned char CMD_ID_RAISE_VOL = 0x01; static const unsigned char CMD_ID_LOWER_VOL = 0x02; static const unsigned char CMD_ID_SET_VOL = 0x03; static cons...
picardb/QtRemoteTestClient
src/widgets/DeviceWidget.h
#pragma once #include <QWidget> #include <QLabel> #include <QTableView> #include <QHostAddress> class DeviceWidget : public QWidget { Q_OBJECT private: QLabel *m_pStatusLabel; QTableView *m_pDeviceList; protected: void showEvent(QShowEvent *event); public: DeviceWidget(QWidget *parent = 0); ...
picardb/QtRemoteTestClient
src/widgets/AudioWidget.h
#pragma once #include <QWidget> #include <QPushButton> #include "model/Model.h" class AudioWidget : public QWidget { Q_OBJECT private: QPushButton *m_pRaiseButton; QPushButton *m_pLowerButton; QPushButton *m_pMuteButton; public: AudioWidget(QWidget *parent = 0); private slots: v...
Korune/KOBaiSiBuDeJie
KOBaiSiBuDeJie/ViewController.h
<reponame>Korune/KOBaiSiBuDeJie // // ViewController.h // KOBaiSiBuDeJie // // Created by Korune on 2017/7/16. // Copyright © 2017年 Korune. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
Krzem5/C-Custom_Lang_Compiler
src/compiler/free.c
#include <common.h> #include <free.h> #include <loader.h> #include <ast.h> #include <stdio.h> #include <stdlib.h> void free_file_object(FileObject fo){ assert(fo->fp!=NULL); assert(fo->dt!=NULL); free(fo->fp); free(fo->dt); free(fo); } void free_ast_object(ASTObject ast){ free(ast); }
Krzem5/C-Custom_Lang_Compiler
src/include/loader.h
#ifndef __LOADER_H__ #define __LOADER_H__ #include <common.h> #include <stdio.h> typedef struct _SEARCH_PATH_LIST SearchPathList; typedef struct _FILE_OBJECT* FileObject; struct _SEARCH_PATH_LIST_ELEM{ uint32_t ln; char* p; }; struct _SEARCH_PATH_LIST{ uint32_t ln; struct _SEARCH_PATH_LIST_ELEM* e; }; s...
Krzem5/C-Custom_Lang_Compiler
src/compiler/ast.c
<gh_stars>0 #include <common.h> #include <ast.h> #include <loader.h> #include <stdlib.h> #include <stdio.h> #define CHR_CMP_RET(c,v) \ if (*(fo->dt+t->_off)==c){ \ t->t=AST_TOKEN_TYPE_OPERATOR; \ t->dt.op=v; \ t->_off++; \ return 0; \ } #define STR_CMP_RET(s,l,_t,tt,tv) \ if (t->_off+l<=fo->ln){ \ for (...
Krzem5/C-Custom_Lang_Compiler
src/compiler/loader.c
#include <common.h> #include <loader.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> SearchPathList loader_search_path_list={ 0, NULL }; void loader_add_search_path(char* p){ assert(p!=NULL); uint32_t ln=0; while (*(p+ln)!=0){ ln++; } assert(ln>0); if (*(p+ln-1)!='/'&&*(p+ln-1)!='\\'){ *(...
Krzem5/C-Custom_Lang_Compiler
src/include/ast.h
#ifndef __PARSER_H__ #define __PARSER_H__ #include <common.h> #include <loader.h> #include <stdio.h> typedef struct _AST_TOKEN ASTToken; typedef struct _AST_EXPRESSION_ARG ASTExpressionArg; typedef struct _AST_EXPRESSION* ASTExpression; typedef struct _AST_OBJECT* ASTObject; enum AST_TOKEN_TYPE{ AST_TOKEN_TYPE_U...
Krzem5/C-Custom_Lang_Compiler
src/include/free.h
<reponame>Krzem5/C-Custom_Lang_Compiler<filename>src/include/free.h<gh_stars>0 #ifndef __FREE_H__ #define __FREE_H__ #include <loader.h> #include <ast.h> void free_file_object(FileObject fo); void free_ast_object(ASTObject ast); #endif
Krzem5/C-Custom_Lang_Compiler
src/include/compiler.h
<reponame>Krzem5/C-Custom_Lang_Compiler<gh_stars>0 #ifndef __COMPILER_H__ #define __COMPILER_H__ int compiler_run_all(int argc,const char** argv); #endif
Krzem5/C-Custom_Lang_Compiler
src/include/common.h
#ifndef __COMMON_H__ #define __COMMON_H__ #include <stdint.h> #include <limits.h> #include <signal.h> #ifdef NULL #undef NULL #endif #define NULL ((void*)0) #define bool _Bool #define true 1 #define false 0 #define assert(x) \ do{ \ if (!(x)){ \ printf("%s: Line %u (%s): %s: Assertion Failed\n",__FILE__,__LINE...
Krzem5/C-Custom_Lang_Compiler
src/include/custom_lang_compiler.h
#ifndef __CUSTOM_LANG_COMPILER_H__ #define __CUSTOM_LANG_COMPILER_H__ 1 // #endif
Krzem5/C-Custom_Lang_Compiler
src/compiler/compiler.c
<reponame>Krzem5/C-Custom_Lang_Compiler<filename>src/compiler/compiler.c #include <common.h> #include <compiler.h> #include <loader.h> #include <free.h> #include <stdio.h> #include <stdlib.h> int compiler_run_all(int argc,const char** argv){ uint32_t fpll=0; char** fpl=NULL; for (int i=1;i<argc;i++){ size_t j=0...
Krzem5/C-Custom_Lang_Compiler
src/main.c
<filename>src/main.c<gh_stars>0 #include <compiler.h> int main(int argc,const char** argv){ return compiler_run_all(argc,argv); }
a64091937/STM32_Basic_Test1
User/rcc/bsp_clkconfig.h
#ifndef __CLKCONFIG_H #define __CLKCONFIG_H #include "stm32f4xx.h" void HSE_SetSysClock(uint32_t m, uint32_t n, uint32_t p, uint32_t q); void HSI_SetSysClock(uint32_t m, uint32_t n, uint32_t p, uint32_t q); void MCO1_GPIO_Config(void); void MCO2_GPIO_Config(void); #endif /* __CLKCONFIG_H */
FenomenCoyote/Redes
Practica2.2/ejercicio8/Chat.h
<reponame>FenomenCoyote/Redes<filename>Practica2.2/ejercicio8/Chat.h<gh_stars>0 #ifndef _CHAT_H #define _CHAT_H #include <string> #include <unistd.h> #include <string.h> #include <vector> #include <memory> #include "Serializable.h" #include "Socket.h" //---------------------------------------------------------------...
bananita/Echoes
Echoes/Echoes/MBERequest.h
<reponame>bananita/Echoes<filename>Echoes/Echoes/MBERequest.h // // MBERequest.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <Foundation/Foundation.h> @interface MBERequest : NSObject <NSCopying> @property NSString *URL; @property NSString ...
bananita/Echoes
Echoes/Echoes/MBECurrentRecordingSetProvider.h
<gh_stars>0 // // MBECurrentRecordingSetProvider.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <Foundation/Foundation.h> #import "MBERequest.h" #import "MBERecord.h" @interface MBECurrentRecordingSetProvider : NSObject @property NSMutableDi...
bananita/Echoes
Echoes/Echoes/MBERecord.h
<filename>Echoes/Echoes/MBERecord.h // // MBERecord.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <Foundation/Foundation.h> @interface MBERecord : NSObject @property NSDictionary *headers; @property NSUInteger statusCode; @property NSData *...
bananita/Echoes
Echoes/Echoes/MBEReplayingProtocol.h
// // MBEReplayingProtocol.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <Foundation/Foundation.h> @interface MBEReplayingProtocol : NSURLProtocol @end
bananita/Echoes
Echoes/ViewController.h
// // ViewController.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
bananita/Echoes
Echoes/Echoes/Echoes.h
<filename>Echoes/Echoes/Echoes.h // // Echoes.h // Echoes // // Created by <NAME> on 04.06.2015. // Copyright (c) 2015 SO MANY APPS. All rights reserved. // #import <Foundation/Foundation.h> @interface Echoes : NSObject @property BOOL recording; @property NSString *currentRecordingName; + (void)startWithRecordi...
Garciaj007/AEngine
AEngine/src/Core/Utils.h
#pragma once #include "Graphics/Mesh.h" class Utils { public: static std::string ReadTextFile(const char*); };
Garciaj007/AEngine
AEngine/src/Scene/IScene.h
<gh_stars>0 #pragma once #include "Systems/EntityComponent.h" class IScene { public: explicit IScene() = default; virtual ~IScene() = default; virtual bool Initialize() = 0; virtual void Update(const float) = 0; virtual void Render() const = 0; virtual void ResizeUpdate() const = 0; virtual void Destroy() co...
Garciaj007/AEngine
AEngine/src/Graphics/TextureHandler.h
#pragma once struct Texture { GLuint textureId = 0; int width = 0; int height = 0; int colorChannels = 0; }; class TextureHandler { public: TextureHandler(const TextureHandler&) = delete; TextureHandler(TextureHandler&&) = delete; TextureHandler& operator=(const TextureHandler&) = delete; TextureHandler& oper...
Garciaj007/AEngine
AEngine/src/Physics/CollisionDetection.h
<reponame>Garciaj007/AEngine<gh_stars>0 #pragma once #include "Graphics/Camera.h" struct BoundingBox; struct Ray; class CollisionDetection { public: CollisionDetection() = delete; ~CollisionDetection() = delete; static Ray ViewportPointToRay(glm::vec2, glm::vec2, Camera*); static bool RayCastHit(Ray&, BoundingBo...
Garciaj007/AEngine
AEngine/src/Graphics/Camera.h
<filename>AEngine/src/Graphics/Camera.h #pragma once #include "Systems/EntityComponent.h" #include "Components/Transform.h" #include <Rendering\Frustum.h> class Camera final : public Component { public: Camera() = default; Camera(float, glm::vec2, bool lookAtEnabled = true); void Start() override; void Update(co...
Garciaj007/AEngine
AEngine/src/Graphics/MaterialHandler.h
#pragma once class MaterialHandler { public: struct Material { GLuint diffuseMap = 0; float roughness = 0.0f; float transparency = 0.0f; glm::vec3 ambientColor = glm::vec3(1.0f); glm::vec3 diffuseColor = glm::vec3(1.0f); glm::vec3 specularColor = glm::vec3(1.0f); }; MaterialHandler(const MaterialHand...
Garciaj007/AEngine
AEngine/src/Core/Logger.h
<reponame>Garciaj007/AEngine #pragma once class Logger { public: enum class MessageSeverity : unsigned short { RAD_NONE, RAD_INFO, RAD_TRACE, RAD_ERROR, RAD_WARNING, RAD_FATAL_ERROR, }; Logger(const Logger&) = delete; Logger(Logger&&) = delete; Logger& operator=(const Logger&) = delete; Logger& oper...
Garciaj007/AEngine
AEngine/src/Rendering/SceneGraph.h
#pragma once class Model; class Entity; class GameObject; class SceneGraph { public: SceneGraph(const SceneGraph&) = delete; SceneGraph(SceneGraph&&) = delete; SceneGraph& operator=(const SceneGraph&) = delete; SceneGraph& operator=(SceneGraph) = delete; static SceneGraph* GetInstance(); void AddModel(Model*)...
Garciaj007/AEngine
AEngine/src/Events/IEvent.h
<reponame>Garciaj007/AEngine #pragma once #include <Core/AEpch.h> template <typename... Args> class ISubscriber { public: virtual ~ISubscriber() = default; virtual void Invoke(Args... args) = 0; virtual bool IsInstanceOf(void* signature) = 0; }; template <typename T, typename... Args> class Subscriber : public IS...
Garciaj007/AEngine
AEngine/src/Graphics/Light.h
#pragma once #include "Systems/EntityComponent.h" struct Light final : Component { Light(const float ambient, const float diffuse, const glm::vec3 color) : ambient(ambient), diffuse(diffuse), color(color) {} float ambient, diffuse; glm::vec3 color; };
Garciaj007/AEngine
AEngine/src/Graphics/ObjLoader.h
#pragma once #include "Graphics/Mesh.h" #include "Physics/BoundingBox.h" class ObjLoader { public: ~ObjLoader(); void LoadMeshData(const std::string& fileName); void LoadMeshData(const std::string& fileName, const std::string& matName); [[nodiscard]] std::vector<Vertex> GetVertices() const { return meshVertice...
Garciaj007/AEngine
AEngine/src/Graphics/MaterialLoader.h
#pragma once class MaterialLoader { public: static void LoadMaterial(const std::string& materialPath); static GLuint LoadMaterialTexture(const std::string& textureFileName); };
Garciaj007/AEngine
AEngine/src/Rendering/Frustum.h
<reponame>Garciaj007/AEngine #pragma once #include "Physics/BoundingBox.h" struct Plane { glm::vec4 plane; glm::vec3 normal; float distance; Plane() = default; explicit Plane(const glm::vec4 plane) : plane(plane), normal(glm::vec3(plane)), distance(plane.w) {} }; class Frustum { public: enum Planes { BOTTO...
Garciaj007/AEngine
AEngine/src/Physics/CollisionHandler.h
#pragma once class GameObject; class Camera; class CollisionHandler { public: CollisionHandler(const CollisionHandler&) = delete; CollisionHandler(CollisionHandler&&) = delete; CollisionHandler& operator=(const CollisionHandler&) = delete; CollisionHandler& operator=(CollisionHandler&&) = delete; static Collisi...
Garciaj007/AEngine
AEngine/src/Resources/ResourceManager.h
<filename>AEngine/src/Resources/ResourceManager.h //#pragma once // //#include "Systems/EntityComponent.h" // ////template <typename... Args> ////struct IAssetBuilder ////{ //// virtual ~IAssetBuilder() = default; //// virtual bool CreateAsset() = 0; ////}; //// ////template <typename... Args> ////class ModelBuilder f...
Garciaj007/AEngine
AEngine/src/Events/MouseEvent.h
<reponame>Garciaj007/AEngine #pragma once #include "IEvent.h" class MouseEventListener : public EventListener<MouseEventListener> { public: void OnMouseMovedEvent(double, double); void OnMouseButtonEvent(int, int, int); void OnMouseScrollEvent(double); void OnMousePressedEvent(int button); void OnMouseReleasedE...
Garciaj007/AEngine
AEngine/src/Graphics/Shader.h
<reponame>Garciaj007/AEngine #pragma once class ShaderHandler { public: ShaderHandler(const ShaderHandler&) = delete; ShaderHandler(ShaderHandler&&) = delete; ShaderHandler& operator=(const ShaderHandler&) = delete; ShaderHandler& operator=(ShaderHandler&&) = delete; static ShaderHandler* GetInstance(); GLuint ...
Garciaj007/AEngine
AEngine/src/Physics/Ray.h
<reponame>Garciaj007/AEngine<filename>AEngine/src/Physics/Ray.h #pragma once #include <Core/AEpch.h> #include "BoundingBox.h" #include "CollisionDetection.h" #include "Graphics/ShaderHandler.h" struct Ray { Ray() = default; Ray(const glm::vec3 origin, const glm::vec3 direction, const glm::vec2 dimensions) : origi...
Garciaj007/AEngine
AEngine/src/Rendering/GameObject.h
#pragma once #include "Core/Logger.h" class CollisionHandler; class Model; class EntityManager; struct BoundingBox; class GameObject { public: GameObject() = default; GameObject(EntityManager*, Model*); GameObject(EntityManager*, struct TransformData&, Model*); ~GameObject(); void Update(float) const; void Ren...
Garciaj007/AEngine
AEngine/src/Graphics/Mesh.h
<reponame>Garciaj007/AEngine<filename>AEngine/src/Graphics/Mesh.h #pragma once #include <Core/AEpch.h> #include "MaterialHandler.h" struct Vertex { glm::vec3 position; glm::vec3 normal; glm::vec3 color; glm::vec2 uvCoords; }; struct Mesh { std::vector<Vertex> vertices = std::vector<Vertex>(); std::vector<GLuint...
Garciaj007/AEngine
AEngine/src/Graphics/Model.h
<gh_stars>0 #pragma once #include "Mesh.h" class Camera; struct ModelData { class Entity* camera = nullptr; GLuint shaderProgram = 0; std::string objPath = std::string(); std::string materialPath = std::string(); }; class Model { public: explicit Model(const ModelData&); explicit Model(ModelData&&); ~Model();...
Garciaj007/AEngine
AEngine/src/Window/Window.h
<reponame>Garciaj007/AEngine #pragma once class Window { public: Window(); ~Window(); Window(const Window&) = delete; Window(Window&&) = delete; Window& operator=(const Window&) = delete; Window& operator=(Window&&) = delete; // ==================================================== bool Create(std::string, s...
Garciaj007/AEngine
AEngine/src/Core/AEApplication.h
<filename>AEngine/src/Core/AEApplication.h #pragma once class AEApplication { public: AEApplication(const AEApplication&) = delete; AEApplication(AEApplication&&) = delete; AEApplication& operator=(const AEApplication&) = delete; AEApplication& operator=(AEApplication&&) = delete; bool Initialize(); void Run() ...
Garciaj007/AEngine
AEngine/src/Core/AEpch.h
<filename>AEngine/src/Core/AEpch.h<gh_stars>0 #pragma once #include <Windows.h> #include <iostream> #include <fstream> #include <sstream> #include <memory> #include <algorithm> #include <utility> #include <functional> #include <bitset> #include <array> #include <ctime> #include <ratio> #include <chrono> #include <st...
Garciaj007/AEngine
AEngine/src/Scene/CubeScene.h
<reponame>Garciaj007/AEngine #pragma once #include "Scene/IScene.h" class CubeScene final : public IScene { public: virtual bool Initialize() override; virtual void Update(const float dt) override; virtual void Render() const override; virtual void ResizeUpdate() const override; private: Entity* cubeEntityPtr ...
Garciaj007/AEngine
AEngine/src/Physics/BoundingBox.h
<reponame>Garciaj007/AEngine #pragma once #include <Systems/EntityComponent.h> #include "Graphics/Mesh.h" #include "Graphics/Model.h" #include "Components/Transform.h" #include "Rendering/GameObject.h" constexpr void LimitScale(glm::vec3& v) { v.x = v.x < 1.0f ? v.x / 2.0f : v.x; v.y = v.y < 1.0f ? v.y / 2.0f : v.y...
Garciaj007/AEngine
AEngine/src/Scene/ModelScene.h
#pragma once #include "Scene/IScene.h" #include "Rendering/GameObject.h" class SceneGraph; class ModelScene final : public IScene { public: virtual bool Initialize() override; virtual void Update(const float dt) override; virtual void Render() const override; virtual void ResizeUpdate() const override; virtual...
Garciaj007/AEngine
AEngine/src/Components/Transform.h
<reponame>Garciaj007/AEngine #pragma once #include <Core/AEpch.h> #include "Systems/EntityComponent.h" struct TransformData { glm::vec3 position = glm::vec3(0.0f); glm::vec3 scale = glm::vec3(1.0f); glm::quat rotation = glm::quat(glm::vec4(0.0f)); }; class Transform final : public Component { public: Transform(...
Garciaj007/AEngine
AEngine/src/Core/Timer.h
<reponame>Garciaj007/AEngine #pragma once #include <Core/AEpch.h> #include "AEApplication.h" #include "Logger.h" class Timer { public: typedef void(AEApplication::*TimerAction)()const; Timer(const double rate) : sleepTime(GetSleepTime(rate)), previousTime(glfwGetTime()), tickTime(previousTime), currentT...
Garciaj007/AEngine
AEngine/src/Systems/EntityComponent.h
<gh_stars>0 #pragma once #include <Core/AEpch.h> class Component; class Entity; class EntityManager; using ComponentTypeID = std::size_t; using EntityGroup = std::size_t; inline ComponentTypeID getNewComponentTypeID() { static ComponentTypeID id = 0u; return id++; } template <typename T> inline ComponentTypeID g...
abhinav-upadhyay/spell
dictionary.c
#define _GNU_SOURCE #include <ctype.h> #include <err.h> #include <errno.h> #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "spellutil.h" typedef struct word_count { int value; } count; static void usage(void) { fprintf(stderr, "Usage: dictionary -i InputFile -o outputF...
abhinav-upadhyay/spell
spell_hash_test.c
#define _GNU_SOURCE #include <assert.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "spellutil.h" typedef struct int_struct { int i; } int_struct; static void test_spell_hash_init() { spell_hashtable *table = spell_hashtable_init(63); assert...
abhinav-upadhyay/spell
spellutil.c
<filename>spellutil.c #include <assert.h> #include <err.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include "spellutil.h" spell_list_node * spell_list_init(void *data) { spell_list_node *head = malloc(sizeof(spell_list_node)); if (head == NULL) { ...
abhinav-upadhyay/spell
libspell.h
<filename>libspell.h #ifndef LIBSPELL_H #define LIBSPELL_H char *spell(char *); char *get_suggestions(char *); #endif
abhinav-upadhyay/spell
spell_list_test.c
<filename>spell_list_test.c #include <assert.h> #include <stdio.h> #include <string.h> #include "spellutil.h" static void test_list_init() { spell_list_node *n = NULL; printf("[PASSED] test_list_init\n"); spell_list_free(&n, NULL); } static void test_list_add_one() { int j = 20; spell_list_node *...
abhinav-upadhyay/spell
libspell.c
<reponame>abhinav-upadhyay/spell #include <assert.h> #include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "libspell.h" #include "spellutil.h" #define N_PERMUTATIONS(n) 54 * n +25 typedef struct set { char *a; char *b; } set; typedef struct count { int count; } count; static ...
abhinav-upadhyay/spell
spellutil.h
<reponame>abhinav-upadhyay/spell #ifndef SPELLUTIL_H #define SPELLUTIL_H #include <sys/types.h> #include <stdbool.h> #define SPELL_HASHTABLE_INIT_SIZE 32 typedef struct spell_list_node { struct spell_list_node *next; void *data; } spell_list_node; typedef struct spell_hashtable_t { spell_list_node **ar...
msakai/haskell_cudd
c_sources/cuddwrap.c
#include <stdio.h> #include <math.h> #include <assert.h> #include "util.h" #include "cudd.h" //Function wrappers around macros DdNode *wrappedRegular(DdNode *f){ assert(f); return Cudd_Regular(f); } void wrappedCuddRef(DdNode *f){ assert(f); Cudd_Ref(f); } int wrappedCuddIsComplement(DdNode *f){ retur...
sbalk/tensorflow
tensorflow/contrib/lite/delegates/eager/test_util.h
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
depp/raycast
src/imath.c
<filename>src/imath.c #include "imath.h" #include "defs.h" static const unsigned short SIN_TABLE[65] = { 0, 804, 1608, 2411, 3212, 4011, 4808, 5602, 6393, 7180, 7962, 8740, 9513, 10279, 11040, 11794, 12540, 13280, 14011, 14734, 15448, 16152, 16847, 17532, 18206, 18869, 19521, 20161, 20789, 21404, 22007...
depp/raycast
src/texture.h
<filename>src/texture.h /* Each "pixels[n]" pointer points to a 32-bit texture with dimensions (w >> n) by (h >> n), with minimum width and height 1. The textures are stored as columns starting with the top left pixel. */ struct texture { unsigned wbits, hbits; unsigned count; void *pixels[]; }; ...