repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
kevin-luvian/opengl
basic/src/draw/renderer/Renderers.h
#pragma once #include "Renderer.h" #include "impl/LightRenderer.h" #include "impl/SimpleRenderer.h"
kevin-luvian/opengl
basic/src/draw/material/Material.h
<filename>basic/src/draw/material/Material.h #pragma once class Material { public: float mSpecularIntensity = 2.2f; float mShine = 8.0f; Material() {} ~Material() {} };
kevin-luvian/opengl
basic/src/random/XorshiftP.h
#pragma once #include <stdint.h> struct xorshift128p_state { uint64_t a, b; }; namespace XorshiftP { static uint64_t GetRandom(xorshift128p_state &state) { uint64_t t = state.a; uint64_t const s = state.b; state.a = s; t ^= t << 23; // a t ^= t >> 17; /...
kevin-luvian/opengl
basic/src/light/impl/DirectionalLight.h
#pragma once #include "light/Light.h" class DirectionalLight : public Light { protected: glm::vec3 mDiffuseDirection; public: DirectionalLight() { mAmbientIntensity = 0.08f; mDiffuseDirection = glm::vec3(0.0, -0.5, 3.0); mDiffuseIntensity = 0.5f; } ~DirectionalLight() {} ...
kevin-luvian/opengl
basic/src/mesh/Vertex.h
#pragma once struct Vertex { glm::vec3 pos; glm::vec4 colour = glm::vec4(1.0, 0.0, 0.0, 1.0); glm::vec3 normal; void createColourFromPos() { colour = glm::vec4(clampPos(0.0, 1.0), 1.0) + glm::vec4(0.0, 0.4, 0.7, 0.2); } static unsigned long posCount() { return 3; } friend std::ostream &operato...
kevin-luvian/opengl
basic/src/light/impl/ObjectPointLight.h
#pragma once #include "PointLight.h" #include "object/Object.h" #include "draw/shader/ShaderEnum.h" class ObjectPointLight : public PointLight { private: std::unique_ptr<Object> mObject; public: ObjectPointLight(Object *object) { mObject = std::unique_ptr<Object>(object); mObject->setPosi...
kevin-luvian/opengl
basic/src/screenview/Camera.h
#pragma once #include "ScreenState.h" class Camera { private: bool firstMoveFlag; float moveSpeed = 10.0f, turnSpeed = 0.1f, deltaTime = 0.0f, lastFrame = 0.0f, viewRange = 100.0f; glm::mat4 view, projection, viewProjection; glm::vec3 pos; glm::vec3 worldUp, camFront, camRight, camUp; glm::vec...
kevin-luvian/opengl
basic/src/draw/shader/ShaderUniform.h
<reponame>kevin-luvian/opengl<gh_stars>0 #pragma once namespace ShaderUniform { static const std::string VSIMPLE_MVP = "mvp"; static const std::string V_MODEL = "model"; static const std::string V_VIEW = "view"; static const std::string V_PROJECTION = "projection"; static const std::string F_CAME...
kevin-luvian/opengl
basic/src/draw/shader/ShaderClass.h
<gh_stars>0 #pragma once #include <unordered_map> #include <glm/gtc/type_ptr.hpp> #include <fstream> #include "object/Object.h" class ShaderClass { public: std::unordered_map<std::string, unsigned int> uniformLookup; explicit ShaderClass() { programID = 0; }; virtual ~ShaderClass() { clear(); }; // ...
kevin-luvian/opengl
basic/src/object/impl/ShadedPyramid.h
<reponame>kevin-luvian/opengl<filename>basic/src/object/impl/ShadedPyramid.h #pragma once #include "object/Object.h" class ShadedPyramid : public Object { private: Enum::ShaderType dynamicSType; public: ShadedPyramid() { dynamicSType = Enum::ShaderType::Light; } ~ShadedPyramid() {} void setMesh() ove...
kevin-luvian/opengl
basic/src/draw/shader/impl/SimpleShader.h
#pragma once #include "object/Object.h" #include "draw/shader/ShaderUniform.h" #include "draw/shader/ShaderClass.h" #include "screenview/Camera.h" class SimpleShader : public ShaderClass { public: SimpleShader() {} ~SimpleShader() {} void compile() override { compileFromFile("../res/shader/vSimple.vert", ...
kevin-luvian/opengl
basic/src/mesh/Meshes.h
#pragma once #include "Mesh.h" #include "impl/Sheet.h" #include "impl/Sphere.h" #include "impl/Pyramid.h"
kevin-luvian/opengl
basic/src/draw/shader/ShaderManager.h
#pragma once #include "ShaderEnum.h" #include "ShaderClass.h" #include "impl/SimpleShader.h" #include "impl/LightShader.h" class ShaderManager { private: DetailedArray<Enum::ShaderType> mShaderTypes; std::unique_ptr<SimpleShader> mSimpleShader; std::unique_ptr<LightShader> mLightShader; public: Shade...
kevin-luvian/opengl
basic/src/light/impl/PointLight.h
<reponame>kevin-luvian/opengl<filename>basic/src/light/impl/PointLight.h #pragma once #include <algorithm> #include "LightFactor.h" #include "light/Light.h" #include "screenview/Camera.h" class PointLight : public Light { protected: glm::vec3 mPosition; glm::vec3 mAttenuation; float distToCamera; voi...
kevin-luvian/opengl
basic/src/object/impl/ShadedSheet.h
#pragma once #include "object/Object.h" class ShadedSheet : public Object { public: unsigned int width, height; ShadedSheet() : ShadedSheet(10, 10) {} ShadedSheet(unsigned int w, unsigned int h) : width(w), height(h) {} ~ShadedSheet() {} void setMesh() override { mesh = std::make_uniqu...
kevin-luvian/opengl
basic/src/draw/renderer/impl/SimpleRenderer.h
#pragma once #include "draw/renderer/Renderer.h" class SimpleRenderer : public Renderer { private: typedef Renderer inherited; public: SimpleRenderer() {} ~SimpleRenderer() {} virtual void bindLayouts(){}; virtual void unbindLayouts(){}; virtual void create(Mesh &mesh) { BENCHMAR...
kevin-luvian/opengl
basic/src/util/DetailedArray.h
<reponame>kevin-luvian/opengl #pragma once template <typename T> struct DetailedArray { std::unique_ptr<T[]> data; long size; T *get() { return data.get(); } void make_empty(long size_) { data = std::make_unique<T[]>(size_); size = size_; } void make_from(D...
kevin-luvian/opengl
basic/src/light/Light.h
#pragma once class Light { protected: glm::vec3 mAmbientColour; float mAmbientIntensity; float mDiffuseIntensity; public: Light() { mAmbientColour = glm::vec3(1.0f, 1.0f, 1.0f); mAmbientIntensity = 0.1f; mDiffuseIntensity = 0.3f; } virtual ~Light() {} glm::vec3...
kevin-luvian/opengl
basic/src/object/Renderable.h
<gh_stars>0 #pragma once #include "mesh/Mesh.h" #include "draw/material/Material.h" #include "draw/renderer/Renderers.h" #include "draw/shader/ShaderEnum.h" class Renderable { public: Renderable() {} virtual ~Renderable() {} virtual Material &getMaterial() { return *material.get(); } virtual Renderer...
kevin-luvian/opengl
basic/src/mesh/Mesh.h
#pragma once #include "Indice.h" #include "Vertex.h" class Mesh { public: DetailedArray<Vertex> vertices; DetailedArray<Indice> indices; Mesh() {} virtual ~Mesh() {} virtual void createMesh() = 0; void release() { indices.release(); vertices.release(); } void crea...
kevin-luvian/opengl
basic/src/light/impl/LightFactor.h
<filename>basic/src/light/impl/LightFactor.h #pragma once namespace LightFactor { namespace Attenuation { static const glm::vec3 Dist_7 = glm::vec3(1.0, 0.7, 1.8); static const glm::vec3 Dist_13 = glm::vec3(1.0, 0.35, 0.44); static const glm::vec3 Dist_20 = glm::vec3(1.0, 0.22, 0.20); ...
kevin-luvian/opengl
basic/src/util/Benchmark.h
<gh_stars>0 #pragma once #include <chrono> #include <functional> #include <fstream> #include <thread> #include <mutex> #define PROFILING 1 #if PROFILING #define BENCHMARK_PROFILE() BENCHMARK_PROFILE_NAME(__PRETTY_FUNCTION__) #define BENCHMARK_PROFILE_NAME(name) Timer timer(name) #else #define BENCHMARK_PROFILE() #def...
kevin-luvian/opengl
basic/src/draw/renderer/impl/LightRenderer.h
#pragma once #include "draw/renderer/Renderer.h" class LightRenderer : public Renderer { private: typedef Renderer inherited; public: LightRenderer() {} ~LightRenderer() {} virtual void bindLayouts() { glEnableVertexAttribArray(2); }; virtual void unbindLayouts() { gl...
Ismael-Albuquerque/Quadrantes
Quadrante.c
<reponame>Ismael-Albuquerque/Quadrantes<gh_stars>0 #include <stdio.h> int main () { float x, y; printf("Digite o valor de x:"); scanf("%f", &x); printf("Digite o valor de y:"); scanf("%f", &y); if(x > 0 && y > 0 ) { if (x > 0 && y > 0) { pr...
woodruffw-forks/clang
include/clang/AST/JSONNodeDumper.h
//===--- JSONNodeDumper.h - Printing of AST nodes to JSON -----------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
woodruffw-forks/clang
test/Analysis/exploded-graph-rewriter/escapes.c
// FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg. // RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-dump-egraph=%t.dot %s // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s // REQUIRES: a...
farelrz14/cpp
Ejercicios/Tarea7-Punto-de-Venta/menu.h
int menu();
katahiromz/Win32Templates
Common/fakegdiplus.h
<gh_stars>1-10 #pragma once typedef struct GdiplusStartupInput { UINT32 GdiplusVersion; void *DebugEventCallback; BOOL SuppressBackgroundThread; BOOL SuppressExternalCodecs; } GdiplusStartupInput; typedef struct GdiplusStartupOutput { LPVOID dummy1, dummy2; } GdiplusStartupOutput; typedef INT GpS...
katahiromz/Win32Templates
WindowApp/stdafx.h
#pragma once #include "targetver.h" #include "Common.h" #include "resource.h" #define MAINWND_CLASSNAME TEXT("WindowApp by katahiromz") #define IDW_STATUSBAR 1
katahiromz/Win32Templates
Common/Picture.c
<filename>Common/Picture.c #include "Common.h" #include <olectl.h> #pragma comment(lib, "ole32.lib") HBITMAP LoadPictureFromFileDx(LPCTSTR pszFileName) { HANDLE hFile; DWORD cb, cbRead; HGLOBAL hMem = NULL; HBITMAP hbm = NULL; LPVOID pMem = NULL; IStream *pifStream = NULL; IPicture *pifPic = N...
katahiromz/Win32Templates
Common/Utils.h
<reponame>katahiromz/Win32Templates #pragma once #ifdef __cplusplus extern "C" { #endif LPTSTR LoadStringDx(INT nID); // no free LONG RegMakeDx(HKEY hKey, LPCTSTR name, HKEY *phkeyResult); // RegCloseKey VOID CenterWindowDx(HWND hwnd); INT MsgBoxDx(HWND hwnd, LPCTSTR text, LPCTSTR title, UINT uType); INT ErrorBoxDx(H...
katahiromz/Win32Templates
RichTextFileApp/CommandUI.c
#include "stdafx.h" extern HWND g_hMainWnd; extern HWND g_hCanvasWnd; extern HWND g_hRebar; extern HWND g_hToolbars[DX_APP_NUM_TOOLBARS]; extern HWND g_hStatusBar; static HFONT s_hCanvasFont = NULL; #define IHIML_SMALL 0 #define IHIML_LARGE 1 static HIMAGELIST s_himls[2][DX_APP_NUM_TOOLBARS] = { NULL }; static SIZE ...
katahiromz/Win32Templates
PanelApp/Panel3.c
<filename>PanelApp/Panel3.c #include "stdafx.h" #define PANEL_INDEX 2 static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { panel_OnInit(hwnd, PANEL_INDEX); return TRUE; } static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { switch (id) { case psh1: case ps...
katahiromz/Win32Templates
Common/Image.c
<reponame>katahiromz/Win32Templates<gh_stars>1-10 #include "Common.h" #ifdef __cplusplus #include <gdiplus.h> #else #include "fakegdiplus.h" #endif #pragma comment(lib, "gdiplus.lib") HBITMAP LoadImageFromFileDx(LPCTSTR pszFileName) { HBITMAP hbm = NULL; LPWSTR pszWideFileName = WideFromText(pszFileNam...
katahiromz/Win32Templates
PanelApp/PanelApp.c
<filename>PanelApp/PanelApp.c #include "stdafx.h" #define DX_APP_NUM_PANELS 3 #define DX_APP_NUM_ICONS 3 HINSTANCE g_hInstance = NULL; HWND g_hMainWnd = NULL; HWND g_hCanvasWnd = NULL; HWND g_hwndPanels[DX_APP_NUM_PANELS] = { NULL }; HICON g_hIcons[DX_APP_NUM_ICONS] = { NULL, NULL, NULL }; INT g_iActivePanel = 0; #d...
katahiromz/Win32Templates
Common/Framework.c
<reponame>katahiromz/Win32Templates #include "Common.h" LPTSTR g_pszExeName = NULL; LPTSTR g_pszAppName = NULL; LPTSTR g_pszRegistryKey = NULL; LPTSTR g_pszProfileName = NULL; LPTSTR g_pszHelpName = NULL; void doInitFramework(void) { // get g_pszExeName TCHAR szPath[MAX_PATH]; GetModuleFileName(NULL, szPa...
katahiromz/Win32Templates
RichTextFileApp/stdafx.h
#pragma once #include "targetver.h" #include "Common.h" #include <richedit.h> #include "resource.h" // TODO: Modify if necessary #define DX_APP_MAX_RECENTS 20 #define DX_APP_COMPANY_NAME_IN_ENGLISH TEXT("<NAME>") #define DX_APP_NAME_IN_ENGLISH TEXT("RichTextFileApp") #define DX_APP_MAINWND_CLAS...
katahiromz/Win32Templates
UnicodeConsoleApp/UnicodeConsoleApp.c
<reponame>katahiromz/Win32Templates<filename>UnicodeConsoleApp/UnicodeConsoleApp.c #include "stdafx.h" void version(void) { // TODO: Show version info #ifdef _WIN32 _putts(LoadStringDx(IDS_VERSION)); #else puts("UnicodeConsoleApp ver.0.0"); #endif } void help(void) { // TODO: Show usage printf( ...
katahiromz/Win32Templates
Common/Framework.h
<reponame>katahiromz/Win32Templates<filename>Common/Framework.h #pragma once #include "Recent.h" #define DX_COMPANY_NAME_IN_ENGLISH TEXT("<NAME> MZ") //#define DX_HELPFILE TEXT("README.txt") //#define DX_HELPFILE TEXT("README.htm") #define DX_HELPFILE_DOTEXT TEXT(".TXT") #ifdef __cplusplus extern "C" { #endif exte...
katahiromz/Win32Templates
Common/Bitmap.c
<filename>Common/Bitmap.c #include "Common.h" typedef struct tagBITMAPINFOEX { BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[256]; } BITMAPINFOEX, FAR * LPBITMAPINFOEX; HBITMAP LoadBitmapFromFileDx(LPCTSTR pszFileName) { HANDLE hFile; BITMAPFILEHEADER bf; BITMAPINFOEX bi; DWORD cb, cb...
katahiromz/Win32Templates
Common/Shortcut.c
#include "Common.h" #include <shlobj.h> #include <intshcut.h> #pragma comment(lib, "ole32.lib") #pragma comment(lib, "shell32.lib") #pragma comment(lib, "uuid.lib") #pragma comment(lib, "shlwapi.lib") BOOL CreateShortcutDx(LPCTSTR pszLnkFileName, LPCTSTR pszTargetPathName, ...
katahiromz/Win32Templates
WindowApp/WindowApp.c
<reponame>katahiromz/Win32Templates #include "stdafx.h" HINSTANCE g_hInstance = NULL; HWND g_hMainWnd = NULL; BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) { CenterWindowDx(hwnd); return TRUE; } void OnDropFiles(HWND hwnd, HDROP hdrop) { TCHAR szFile[MAX_PATH]; DragQueryFile(hdrop, 0, szFil...
katahiromz/Win32Templates
Common/Base64.c
#include "Common.h" static char base64table1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; size_t Base64EncodeSize(size_t cbSrc) { return ((cbSrc + 2) / 3) * 4 + 1; } char *Base64Encode(const void *pSrc, size_t cbSrc) { #define B64_ENC(Ch) (base64table1[(unsigned char)(Ch) & 0x3f]) ...
katahiromz/Win32Templates
PanelApp/Canvas.c
#include "stdafx.h" #define CLASS_NAME TEXT("STATIC") extern HINSTANCE g_hInstance; extern HWND g_hCanvasWnd; extern INT g_iActivePanel; static WNDPROC g_fnOldWndProc = NULL; static BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) { return TRUE; } static void OnDrawClient(HWND hwnd, HDC hdc) { RECT ...
katahiromz/Win32Templates
TextFileApp/CommandUI.c
<reponame>katahiromz/Win32Templates #include "stdafx.h" extern HWND g_hMainWnd; extern HWND g_hCanvasWnd; extern HWND g_hToolbar; extern HWND g_hStatusBar; static HFONT s_hCanvasFont = NULL; static HIMAGELIST s_himlToolbar = NULL; // image list for toolbar ///////////////////////////////////////////////////////////...
katahiromz/Win32Templates
Common/Common.h
<gh_stars>1-10 #pragma once #include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> #include "Base64.h" #ifdef WIN32 #include <windows.h> #include <windowsx.h> #include <commctrl.h> #include <commdlg.h> #include <shellapi.h> #include <shlwapi.h> #include <crtdbg.h> ...
katahiromz/Win32Templates
Common/Recent.h
<gh_stars>1-10 #pragma once #ifdef __cplusplus extern "C" { #endif struct RECENT; typedef struct RECENT *PRECENT; PRECENT Recent_New(INT nCapacity); INT Recent_GetCapacity(PRECENT pRecent); INT Recent_GetCount(PRECENT pRecent); LPCTSTR Recent_GetAt(PRECENT pRecent, INT i); void Recent_Print(PRECENT pRecent); INT Rec...
katahiromz/Win32Templates
Common/Base64.h
<filename>Common/Base64.h #pragma once #ifdef __cplusplus extern "C" { #endif size_t Base64EncodeSize(size_t cbSrc); char *Base64Encode(const void *pSrc, size_t cbSrc); size_t Base64DecodeSize(const char *pszSrc, size_t cbSrc); void *Base64Decode(const char *pszSrc, size_t cbSrc, size_t *pcbDest); #ifdef __cplusplus...
katahiromz/Win32Templates
Common/Shortcut.h
<reponame>katahiromz/Win32Templates #pragma once #ifdef __cplusplus extern "C" { #endif BOOL CreateShortcutDx(LPCTSTR pszLnkFileName, LPCTSTR pszTargetPathName, LPCTSTR pszDescription OPTIONAL); BOOL GetPathOfShortcutDx(HWND hWnd, LPCTSTR pszLnkFile, LPTSTR pszPath); BOOL ...
katahiromz/Win32Templates
ConsoleApp/ConsoleApp.c
<reponame>katahiromz/Win32Templates<filename>ConsoleApp/ConsoleApp.c #include "stdafx.h" void version(void) { // TODO: Show version info #ifdef _WIN32 _putts(LoadStringDx(IDS_VERSION)); #else puts("ConsoleApp Ver.0.0"); #endif } void help(void) { // TODO: Show usage puts("Usage: ConsoleApp [Option...
katahiromz/Win32Templates
Common/Utils.c
<reponame>katahiromz/Win32Templates<gh_stars>1-10 #include "Common.h" #include <ctype.h> //#define DX_USE_LOG_FILE #define DX_MAX_LOADSTRING MAX_PATH LPTSTR LoadStringDx(INT nID) { static TCHAR s_szText[3][DX_MAX_LOADSTRING]; static size_t s_i = 0; size_t i = s_i; s_szText[i][0] = 0; LoadString(N...
katahiromz/Win32Templates
RichTextFileApp/resource.h
<gh_stars>1-10 //{{NO_DEPENDENCIES}} // Microsoft Visual C++ Compatible // This file is automatically generated by RisohEditor. // RichTextFileApp_res.rc #define IDB_SMALLTOOLBAR1 100 #define IDB_SMALLTOOLBAR2 101 #define IDB_SMALLTOOLBAR3 102 #define IDB_SMALLTOOL...
katahiromz/Win32Templates
Common/Conv.h
<reponame>katahiromz/Win32Templates<filename>Common/Conv.h #pragma once #ifdef __cplusplus extern "C" { #endif #define CP_JAPANESE 932 // Shift_JIS // nCodePage == CP_ACP, CP_UTF8, or CP_JAPANESE. LPWSTR WideFromAnsi(LPCSTR pszAnsi, UINT nCodePage OPTIONAL); // free LPSTR AnsiFromWide(LPCWSTR pszWide, UINT nCodePage...
katahiromz/Win32Templates
ConsoleApp++/stdafx.h
<gh_stars>1-10 #pragma once #include "targetver.h" #include "Common.h" #include <iostream> #ifdef _WIN32 #include "resource.h" #endif
katahiromz/Win32Templates
TextFileApp/AboutDlg.c
#include "stdafx.h" extern HINSTANCE g_hInstance; BOOL about_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { CenterWindowDx(hwnd); return TRUE; } void about_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { switch (id) { case IDOK: case IDCANCEL: EndDialog(hwnd, i...
katahiromz/Win32Templates
DialogApp++/stdafx.h
<reponame>katahiromz/Win32Templates #pragma once #include "targetver.h" #include "Common.h" #include "resource.h"
katahiromz/Win32Templates
Common/Bitmap.h
#pragma once #ifdef __cplusplus extern "C" { #endif #define GetBitmapInfoDx(hbm, pbm) GetObject((hbm), sizeof(BITMAP), (pbm)) HBITMAP LoadBitmapFromFileDx(LPCTSTR pszFileName); BOOL SaveBitmapToFileDx(LPCTSTR pszFileName, HBITMAP hbm); HBITMAP Create24BppBitmapDx(INT width, INT height); HBITMAP Create32BppBitmapDx(...
katahiromz/Win32Templates
Common/Image.h
<gh_stars>1-10 #pragma once #ifdef __cplusplus extern "C" { #endif // Recommended (gdiplus.dll) HBITMAP LoadImageFromFileDx(LPCTSTR pszFileName); BOOL SaveImageToFileDx(LPCTSTR pszFileName, HBITMAP hbm); // Not recommeded (ole32.dll) HBITMAP LoadPictureFromFileDx(LPCTSTR pszFileName); #ifdef __cplusplus } #endif
katahiromz/Win32Templates
RichTextFileApp/RichTextFileApp.c
<filename>RichTextFileApp/RichTextFileApp.c #include "stdafx.h" /////////////////////////////////////////////////////////////////////////////// // GLOBAL HINSTANCE g_hInstance = NULL; // module handle HWND g_hMainWnd = NULL; // main window HWND g_hCanvasWnd = NULL; // IDW_CANVAS HWND...
katahiromz/Win32Templates
TextFileApp/stdafx.h
#pragma once #include "targetver.h" #include "Common.h" #include "resource.h" // TODO: Modify if necessary #define DX_APP_MAX_RECENTS 20 #define DX_APP_COMPANY_NAME_IN_ENGLISH TEXT("<NAME> MZ") #define DX_APP_NAME_IN_ENGLISH TEXT("TextFileApp") #define DX_APP_MAINWND_CLASSNAME TEXT("Text...
katahiromz/Win32Templates
PanelApp/stdafx.h
<filename>PanelApp/stdafx.h #pragma once #include "targetver.h" #include "Common.h" #include "resource.h" #define MAINWND_CLASSNAME TEXT("WindowApp by katahiromz") #define IDW_STATUSBAR 1 void activatePage(INT iPanel); void panel_OnInit(HWND hwndDlg, INT iPanel);
katahiromz/Win32Templates
Common/Recent.c
<filename>Common/Recent.c<gh_stars>1-10 #include <windows.h> #include <stdio.h> #include <string.h> #include <assert.h> #include <tchar.h> #include "Recent.h" #ifdef __cplusplus extern "C" { #endif typedef struct RECENT { INT nCapacity; INT nCount; LPTSTR apsz[ANYSIZE_ARRAY]; } RECENT; PRECENT Recent_New...
katahiromz/Win32Templates
TextFileApp/resource.h
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ Compatible // This file is automatically generated by RisohEditor. // TextFileApp_res.rc #define IDB_SMALLTOOLBAR 100 #define IDB_LARGETOOLBAR 101 #define IDD_ABOUT 100 #define IDI_MAIN ...
katahiromz/Win32Templates
ConsoleApp/stdafx.h
#pragma once #include "targetver.h" #include "Common.h" #ifdef _WIN32 #include "resource.h" #endif
katahiromz/Win32Templates
WindowApp/resource.h
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ Compatible // This file is automatically generated by RisohEditor. // WindowApp_res.rc #define IDD_ABOUT 100 #define IDI_MAIN 100 #define IDR_MAINMENU 100 #define IDS_FAILREGCLASS ...
katahiromz/Win32Templates
PanelApp/resource.h
<filename>PanelApp/resource.h //{{NO_DEPENDENCIES}} // Microsoft Visual C++ Compatible // This file is automatically generated by RisohEditor. // PanelApp_res.rc #define IDD_ABOUT 100 #define IDD_PANEL1 101 #define IDD_PANEL2 102 #define IDD_P...
Eslzzyl/arithmetic-in-c
declaration.h
<filename>declaration.h /** * 声明文件。 */ #ifndef ARITHMETIC_DECLARATION_H #define ARITHMETIC_DECLARATION_H struct stack_node; //枚举栈的节点 struct stack_double_node; //double栈的节点 struct queue_node; //枚举队列的节点 struct queue_double_node; //d...
Eslzzyl/arithmetic-in-c
implementation.h
<filename>implementation.h<gh_stars>1-10 /** * 本文件实现一些小型的工具函数。 */ #ifndef ARITHMETIC_IMPLEMENTATION_H #define ARITHMETIC_IMPLEMENTATION_H #define STRING_LENGTH 200 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include "declaration.h" enum datatype { ...
Eslzzyl/arithmetic-in-c
implementation_adt.h
<reponame>Eslzzyl/arithmetic-in-c /** * 本文件实现ADT中的各种操作函数。 */ #ifndef ARITHMETIC_IMPLEMENTATION_ADT_H #define ARITHMETIC_IMPLEMENTATION_ADT_H #include "implementation.h" #include "declaration.h" /** * 枚举堆栈的节点 */ struct stack_node { DataType Element; PtrToStackNode Next; }; /** * double堆栈的节点 */ struct s...
Eslzzyl/arithmetic-in-c
calculate.h
/** * 本文件实现Calculate()函数。 */ #ifndef ARITHMETIC_CALCULATE_H #define ARITHMETIC_CALCULATE_H #include "infix_to_postfix.h" /** * 执行计算过程的核心函数 * @param char *str, double *result * @return _Bool isSuccessful */ _Bool Calculate(char *formula, double *result) //返回值标记计算是否成功,1为成功,0为失败 { double ...
Eslzzyl/arithmetic-in-c
infix_to_postfix.h
#ifndef ARITHMETIC_INFIX_TO_POSTFIX_H #define ARITHMETIC_INFIX_TO_POSTFIX_H #include "implementation_adt.h" #include "implementation.h" #include "tokenize.h" _Bool InfixToPostfix(Queue postfix_queue, Doublequeue double_queue, const char *string) { Token token; Stack s2 = CreateStack(); //实现...
Eslzzyl/arithmetic-in-c
tokenize.h
<gh_stars>1-10 /** * 本文件实现Tokenize()函数。 * 本函数用来从字符串中分割出操作符和操作数。 */ #ifndef ARITHMETIC_TOKENIZE_H #define ARITHMETIC_TOKENIZE_H #include "implementation.h" void Tokenize(const char *formula, Token *ptr_to_token, unsigned int *position) { ptr_to_token->isvalid = 1; //默认传入的token是...
Eslzzyl/arithmetic-in-c
main.c
/** * 项目 arithmetic 入口 * 执行标准 C11 * 编译器 GCC 8.1.0 * 参考文献 * Data Structures and Algorithm Analysis in C 2nd Edition by <NAME> */ #include "implementation.h" #include "calculate.h" int main(int argc, char *argv[]) //接收命令行参数 { char *formula; //char *formula:用...
vivook/hlsdl
src/curl.h
#ifndef __hlsdl__curl__ #define __hlsdl__curl__ #ifdef __cplusplus extern "C" { #endif #include <stdbool.h> #define STRING 0x0001 #define BINKEY 0x0002 #define BINARY 0x0003 #define USER_AGENT "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) " \ "AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 " ...
vivook/hlsdl
src/aes.h
<reponame>vivook/hlsdl #ifndef _HLSDL_AES_CRYPTO_H_ #define _HLSDL_AES_CRYPTO_H_ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include <stdbool.h> void * AES128_CBC_CTX_new(void); int AES128_CBC_DecryptInit(void *ctx, uint8_t *key, uint8_t *iv, bool with_padding); int AES128_CBC_Decrypt...
catsocks/tennis-sdl
src/renderer.c
#include "renderer.h" static void update_renderer_wrapper(struct renderer_wrapper *wrapper) { SDL_GetRendererOutputSize(wrapper->renderer, &wrapper->output_size.w, &wrapper->output_size.h); wrapper->scale = fminf(wrapper->output_size.h / (float)wrapper->logical_size.h, ...
catsocks/tennis-sdl
src/math.h
#pragma once #include <SDL.h> #include <math.h> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif float clamp(float x, float min, float max); int rand_range(int min, int max); float frand_range(float min, float max); int sign(int x);
catsocks/tennis-sdl
src/main.c
<reponame>catsocks/tennis-sdl<gh_stars>0 #include <SDL.h> #include <stdbool.h> #include <time.h> #ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif #include "game.h" #include "math.h" #include "renderer.h" #include "tonegen.h" #ifndef DEBUGGING #define DEBUGGING false #endif const int WINDOW_WIDTH = 800; const int...
catsocks/tennis-sdl
src/renderer.h
#pragma once #include <SDL.h> // NOTE: Ditch this when SDL_RenderSetLogicalSize works correctly in the SDL // Emscripten port when the game is made fullscreen. struct renderer_wrapper { SDL_Renderer *renderer; SDL_Rect output_size; SDL_Rect logical_size; SDL_Rect viewport; float scale; }; struct ...
catsocks/tennis-sdl
src/game.h
<filename>src/game.h #pragma once #include <SDL.h> #include <stdbool.h> #include "digits.h" #include "math.h" #include "renderer.h" #include "tonegen.h" extern const int LOGICAL_WIDTH; extern const int LOGICAL_HEIGHT; struct ghost { int idle_offset; float speed; float bias; bool active; float vel...
catsocks/tennis-sdl
src/digits.h
<filename>src/digits.h #pragma once #include <SDL.h> #include "renderer.h" void render_digits(struct renderer_wrapper renderer, SDL_FPoint position, int height, int number);
catsocks/tennis-sdl
src/digits.c
<filename>src/digits.c #include "digits.h" #define POINTS_LIST_MAX_LENGTH 10 #define DIGITS_LENGTH 10 static const float DIGIT_HALF_WIDTH = 0.4f; // determ. by the DIGITS points static const float DIGIT_LINE_SPREAD_FACTOR = 0.3f; struct points { SDL_FPoint list[POINTS_LIST_MAX_LENGTH]; int list_length; }; ...
catsocks/tennis-sdl
src/game.c
<reponame>catsocks/tennis-sdl #include "game.h" const int LOGICAL_WIDTH = 800; const int LOGICAL_HEIGHT = 600; const int NET_WIDTH = 5; const int NET_HEIGHT = 15; static void toggle_fullscreen(struct game *game); static void set_ghost_bias(struct ghost *ghost); static void set_ghost_speed(struct ghost *ghost, float ...
catsocks/tennis-sdl
src/tonegen.c
<filename>src/tonegen.c #include "tonegen.h" static const int FORMAT_MAX_VALUE = INT16_MAX; // determ. by TONEGEN_FORMAT_SIZE const SDL_AudioSpec TONEGEN_AUDIO_SPEC = { .freq = TONEGEN_SAMPLES_PER_SECOND, .format = AUDIO_S16SYS, .channels = 1, .samples = 4096, }; struct tonegen make_tonegen(float vol...
catsocks/tennis-sdl
src/tonegen.h
#pragma once #include <SDL.h> #include <stdbool.h> #include "math.h" #define TONEGEN_SAMPLES_PER_SECOND 44100 #define TONEGEN_FORMAT_SIZE sizeof(int16_t) // sample format #define TONEGEN_BUFFER_MAX_LENGTH (TONEGEN_SAMPLES_PER_SECOND / 10) extern const SDL_AudioSpec TONEGEN_AUDIO_SPEC; struct tonegen { int ampl...
catsocks/tennis-sdl
src/math.c
#include "math.h" float clamp(float x, float min, float max) { return fmaxf(min, fminf(x, max)); } // Return a random integer between min and max (inclusive). int rand_range(int min, int max) { return min + (rand() / ((RAND_MAX / (max - min + 1)) + 1)); } // Return a random floating-point number between min ...
otto001/drandr
util.c
/* See LICENSE file for copyright and license details. */ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "util.h" char buf[1024]; void * ecalloc(size_t nmemb, size_t size) { void *p; if (!(p = calloc(nmemb, size))) die("calloc:"); return p; } void die(const char *fmt...
otto001/drandr
drandr.c
/* See LICENSE file for copyright and license details. */ #include <locale.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <time.h> #include <sys/wait.h> #include <sys/file.h> #include <errno.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #ifdef XINERAMA #include <X11/ext...
otto001/drandr
config.def.h
/* See LICENSE file for copyright and license details. */ /* Default settings; can be overriden by command line. */
otto001/drandr
config.h
/* See LICENSE file for copyright and license details. */ /* Default settings; can be overriden by command line. */ static const char *fonts[] = { "monospace:size=11" }; static const char *colors[SchemeLast][3] = { /* fg bg */ [SchemeSel] = { "#eeeeee", "#0d4b82" }, [S...
mvandi/Flinty
Flinty/src/fl/ecs/MayaCameraComponent.h
#pragma once #include "Component.h" namespace fl { class MayaCameraComponent : public Component { public: private: }; }
mvandi/Flinty
Flinty/src/Flinty.h
<reponame>mvandi/Flinty #pragma once #include <fl/Core.h> #include <fl/Application.h> #include <fl/Layer.h> #include <fl/graphics/Window.h> #include <fl/graphics/Texture2D.h> #include <fl/graphics/Framebuffer2D.h> #include <fl/graphics/VertexArray.h> #include <fl/graphics/VertexBuffer.h> #include <fl/graphics/IndexBu...
mvandi/Flinty
Flinty/src/fl/Input.h
#pragma once #include "fl/Common.h" #include "fl/events/Event.h" #include "fl/math/math.h" #include <functional> struct GLFWwindow; namespace fl { #define MAX_KEYS 1024 #define MAX_BUTTONS 32 typedef std::function<void(Event& event)> WindowEventCallback; class Window; class FL_API InputManager...
mvandi/Flinty
Flinty/src/fl/Core.h
<reponame>mvandi/Flinty #pragma once namespace fl { void FlintyInit(); }
mvandi/Flinty
Flinty/src/fl/String.h
<reponame>mvandi/Flinty #pragma once #include "fl/Common.h" #include "fl/Types.h" #include <string> #include <sstream> typedef std::string String; namespace fl { #define STRINGFORMAT_BUFFER_SIZE 10 * 1024 class FL_API StringFormat { private: static char* s_Buffer; public: templa...
mvandi/Flinty
Flinty/src/fl/graphics/Texture.h
#pragma once #include "fl/assets/Asset.h" namespace fl { enum class TextureFormat { None = 0, RGB, RGBA, F16, F32, Depth }; class FL_API Texture : public Asset { public: virtual int GetWidth() const = 0; virtual int GetHeight() ...
mvandi/Flinty
Flinty/src/fl/Common.h
#pragma once #include "fl/Types.h" // TODO: Move to precompiled header #include <iostream> // Common data structures #include <string> #include <vector> #include <unordered_map> #include <unordered_set> // Disable warnings #pragma warning(disable : 4251) // Some typedefs to rename C++'s questionabl...
mvandi/Flinty
Flinty/src/fl/graphics/IndexBuffer.h
<filename>Flinty/src/fl/graphics/IndexBuffer.h #pragma once #include "fl/Common.h" namespace fl { enum class IndexFormat { None = 0, U16, U32 }; class FL_API IndexBuffer { public: IndexBuffer(unsigned short* indices, uint count); IndexBuffer(uint* indi...
mvandi/Flinty
Flinty/src/fl/graphics/VertexBuffer.h
<reponame>mvandi/Flinty #pragma once #include "fl/Common.h" #include "VertexBufferLayout.h" namespace fl { class FL_API VertexBuffer { public: VertexBuffer(const void* buffer, uint size); ~VertexBuffer(); void SetLayout(const VertexBufferLayout& layout); void Bind() con...
mvandi/Flinty
Flinty/src/fl/ecs/Component.h
<gh_stars>0 #pragma once namespace fl { enum class ComponentType { None = 0, MayaCamera }; class Component { public: Component() {} virtual ~Component() {} protected: }; }