repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
udevbe/skia | tests/ProcessorTest.cpp | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "tests/Test.h"
#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrBitmapTextureMaker.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrDirectContextPriv.h... |
udevbe/skia | modules/svg/src/SkSVGLinearGradient.cpp | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/effects/SkGradientShader.h"
#include "modules/svg/include/SkSVGLinearGradient.h"
#include "modules/svg/include/SkSVGRenderContext.h"
#include "modules/svg/in... |
udevbe/skia | src/gpu/GrYUVABackendTextures.cpp | /*
* Copyright 2020 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/gpu/GrYUVABackendTextures.h"
static int num_channels(const GrBackendFormat& format) {
switch (format.channelMask()) {
case kRed_SkColorChannelFla... |
udevbe/skia | tools/gpu/ManagedBackendTexture.cpp | <reponame>udevbe/skia<filename>tools/gpu/ManagedBackendTexture.cpp
/*
* Copyright 2020 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "tools/gpu/ManagedBackendTexture.h"
#include "include/core/SkImageInfo.h"
#include "include/private... |
udevbe/skia | modules/canvaskit/gm_bindings.cpp | <filename>modules/canvaskit/gm_bindings.cpp
/*
* Copyright 2020 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <set>
#include <string>
#include <emscripten.h>
#include <emscripten/bind.h>
#include <emscripten/html5.h>
#include "gm/gm... |
shanimergui/mat-b-c- | mat.hpp | #pragma once
#include <string>
namespace ariel
{
std::string mat(const int& col, const int& row, const char& sing1, const char& sing2);
int badChars(char c);
}
|
shanimergui/mat-b-c- | mat.cpp | #include <iostream>
#include <stdexcept>
#include <array>
#include "mat.hpp"
namespace ariel
{
int badChars(char c) {
const char ch_a = 127;
const char ch_b = 33;
const int size=5;
std::array<char,size> invalid_chars{'\t','\n','\r',' ','\0'};
for(const auto &i: invalid_chars) // One of the ch... |
shanimergui/mat-b-c- | Test.cpp | <reponame>shanimergui/mat-b-c-<gh_stars>0
#include "doctest.h"
#include "mat.hpp"
#include <string>
#include <algorithm>
#include <ctime>
using namespace std;
using namespace ariel;
string nospaces(string input) {
input.erase(std::remove(input.begin(), input.end(), ' ') , input.end());
input.erase(std::remove(input... |
shanimergui/mat-b-c- | main.cpp | <reponame>shanimergui/mat-b-c-<filename>main.cpp<gh_stars>0
#include <iostream>
#include "mat.hpp"
using namespace std;
int main() {
cout << ariel::mat(3, 3, '@', '-') << endl;
/* Should print:
@@@@@@@@@
@-------@
@-@@@@@-@
@-@---@-@
@-@@@@@-@
@-------@
@@@@@@@@@
*/
cout << ariel::mat(13, 5, '@', '-') << endl;
/... |
Promethaes/GlobalGameJam2020 | RePaIr/src/Billboard.cpp | #include "Billboard.h"
Billboard::Billboard(Cappuccino::Shader* SHADER, const std::vector<Cappuccino::Texture*>& textures)
:Cappuccino::GameObject(*SHADER, textures, { new Cappuccino::Mesh("rectangle_test.obj") })
{
_rigidBody.setGrav(false);
}
void Billboard::childUpdate(float dt)
{
}
|
Promethaes/GlobalGameJam2020 | RePaIr/src/MainScene.cpp | #include "MainScene.h"
MainScene::MainScene(bool yn)
:Cappuccino::Scene(yn), _in(true, std::nullopt),
_pLight(glm::vec2(1600.0f, 1000.0f), { /*defaultLight*/glm::vec3(0.0f,0.0f,0.0f),glm::vec3(0.0f,0.0f,0.0f) }, glm::vec3(0.05f, 0.05f, 0.05f), glm::vec3(0.5f, 0.5f, 0.5f), glm::vec3(0.5f, 0.5f, 0.5f), 512.0f)
{
... |
Promethaes/GlobalGameJam2020 | RePaIr/src/main.cpp | #include "Cappuccino/Application.h"
#include "MainScene.h"
#include "Cappuccino/FrameBuffer.h"
using Application = Cappuccino::Application;
using FontManager = Cappuccino::FontManager;
using Mesh = Cappuccino::Mesh;
using Shader = Cappuccino::Shader;
using SoundSystem = Cappuccino::SoundSystem;
using Texture ... |
akashchavan15/CarND-Kidnapped-Vehicle-Project | src/particle_filter.cpp | <filename>src/particle_filter.cpp
/**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: <NAME>
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "helper_funct... |
Krombik/keypresser | src/addon/virtual.cpp | #include "virtual.hpp"
#ifdef IS_WINDOWS
const std::map<uint8_t, std::array<UINT, 2>> Virtual::msgs = {
{0, {WM_LBUTTONUP, WM_LBUTTONDOWN}},
{1, {WM_RBUTTONUP, WM_RBUTTONDOWN}},
{2, {WM_MBUTTONUP, WM_MBUTTONDOWN}}};
const std::map<UINT, UINT> Virtual::wParams = {{WM_LBUTTONDOWN, MK_LBUTTON},
... |
Krombik/keypresser | src/addon/workwindow.cpp | #include "workwindow.hpp"
#include "helper.hpp"
#ifdef IS_WINDOWS
Napi::Value Workwindow::capture(const Napi::CallbackInfo &info) {
Napi::Env env = info.Env();
RECT rect = {0, 0, 0, 0};
int width, height;
std::string format = "rgba";
uint8_t threshold = 127;
if (info[0].IsObject()) {
Napi::Objec... |
Krombik/keypresser | src/addon/workwindow.hpp | <gh_stars>0
#pragma once
#ifndef WORKWINDOW_H
#define WORKWINDOW_H
#include "types.hpp"
class Workwindow {
public:
Napi::Value capture(const Napi::CallbackInfo &info);
Napi::Value refresh(const Napi::CallbackInfo &info);
Napi::Value getColor(const Napi::CallbackInfo &info);
Napi::Value isForeground(const Nap... |
Krombik/keypresser | src/addon/hardware.cpp | #include "hardware.hpp"
#ifdef IS_WINDOWS
const UINT Hardware::extendKeys[] = {
VK_RCONTROL,
VK_SNAPSHOT,
VK_RMENU,
VK_PAUSE,
VK_HOME,
VK_UP,
VK_PRIOR,
VK_LEFT,
VK_RIGHT,
VK_END,
VK_DOWN,
VK_NEXT,
VK_INSERT,
VK_DELETE,
VK_LWIN,
VK_RWIN,
VK_APPS,
... |
Krombik/keypresser | src/addon/virtual.hpp | <reponame>Krombik/keypresser
#pragma once
#ifndef VIRTUAL_H
#define VIRTUAL_H
#include "keyboard.hpp"
#include "mouse.hpp"
#include "workwindow.hpp"
class Virtual : public Keyboard, public Mouse, public Workwindow, public Napi::ObjectWrap<Virtual> {
public:
static Napi::Object Init(Napi::Env env, Napi::Object expo... |
Krombik/keypresser | src/addon/hardware.hpp | <gh_stars>0
#pragma once
#ifndef HARDWARE_H
#define HARDWARE_H
#include "keyboard.hpp"
#include "mouse.hpp"
#include "workwindow.hpp"
class Hardware : public Keyboard, public Mouse, public Workwindow, public Napi::ObjectWrap<Hardware> {
public:
static Napi::Object Init(Napi::Env env, Napi::Object exports);
Hardw... |
Krombik/keypresser | src/addon/hotkey.cpp |
#include "hotkey.hpp"
#include "helper.hpp"
#ifdef IS_WINDOWS
std::set<TsfnContext *> Hotkey::hotkeyPointers;
void Hotkey::unregisterDuplicate(UINT keyCode) {
for (auto it = hotkeyPointers.begin(); it != hotkeyPointers.end(); ++it) {
if ((*it)->keyCode == keyCode) {
(*it)->keyCode = NONEXISTENT_VIRTUAL... |
Krombik/keypresser | src/addon/helper.hpp | #pragma once
#ifndef HELPER_H
#define HELPER_H
#include "types.hpp"
class Helper {
public:
static std::wstring bufferToWstring(Napi::Value val);
#ifdef IS_WINDOWS
static std::wstring classNameGetter(HWND hWnd);
static std::wstring titleGetter(HWND hWnd);
static Napi::Object windowGetter(HWND hWnd, Napi::Env... |
Krombik/keypresser | src/addon/includes.hpp | <filename>src/addon/includes.hpp
#pragma once
#ifndef INCLUDES_H
#define INCLUDES_H
#define NAPI_VERSION 5
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if defined(TARGET_OS_MAC)
#define IS_MACOS
#endif
#endif
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#include <W... |
Krombik/keypresser | src/addon/keyboard.cpp | <reponame>Krombik/keypresser<filename>src/addon/keyboard.cpp
#include "keyboard.hpp"
#include "helper.hpp"
#ifdef IS_WINDOWS
void Keyboard::toggleKey(const Napi::CallbackInfo &info) {
if (info.Length() != 2 || (!info[0].IsString() && !info[0].IsNumber()) || !info[1].IsBoolean()) {
Napi::Error::New(info.Env(), ... |
Hoyr/futlol | futlol.cc | // <NAME> 2020/12/14
//
// 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 agreed to in writing, ... |
ZachHembree/reshade | source/QuakeFX/render/qfx_capture_buffer.hpp | #ifndef QFX_CAPTURE_BUFFER_H
#define QFX_CAPTURE_BUFFER_H
#include "render/qfx_texture2D.hpp"
#include "render/qfx_program.hpp"
#include "render/qfx_buffer.hpp"
#include "render/qfx_framebuffer_obj.hpp"
#include "render/qfx_vertex_array_obj.hpp"
#include "render/qfx_vertex_layout.hpp"
#include "render/qfx_default_shade... |
ZachHembree/reshade | source/QuakeFX/render/qfx_default_shader.hpp | <gh_stars>0
#ifndef QFX_DEFAULT_SHADER_H
#define QFX_DEFAULT_SHADER_H
const char *const defaultShaderSrc =
R"(
#shader vertex
#version 330 core
layout(location = 0) in vec2 position;
layout(location = 1) in vec2 texCoord;
out vec2 v_TexCoord;
void main()
{
gl_Position.xy = position;
gl_Position.zw = vec2(0.0f, ... |
ZachHembree/reshade | source/QuakeFX/qfx_config.cpp | #include <stdio.h>
#include <fstream>
#include <wtypes.h>
#include <dll_config.hpp>
#include <dll_log.hpp>
#include <mutex>
#include "qfx_runtime.hpp"
using namespace reshade;
using namespace reshade::opengl;
namespace QuakeFX
{
using wstring = std::wstring;
template <class _Mutex>
using unique_lock = std::unique... |
ZachHembree/reshade | source/d3d9/render_d3d9.hpp | <reponame>ZachHembree/reshade
/*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "com_ptr.hpp"
#include "com_tracking.hpp"
#include "addon_manager.hpp"
#include "state_block_d3d9.hpp"
namespace reshade::d3d9
{
class device_impl : pu... |
ZachHembree/reshade | source/QuakeFX/render/qfx_framebuffer_obj.hpp | <gh_stars>0
#ifndef QFX_FRAMEBUFFER_OBJ_H
#define QFX_FRAMEBUFFER_OBJ_H
#include <string>
#include "opengl/qfx_opengl.hpp"
#include "render/qfx_texture.hpp"
#include "render/qfx_render_buffer.hpp"
namespace QuakeFX
{
/// <summary>
/// Bit masks used to target specific buffers
/// </summary>
enum class Framebuffer... |
ZachHembree/reshade | source/d3d11/runtime_d3d11.hpp | /*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "runtime.hpp"
#include "render_d3d11.hpp"
#include "state_block_d3d11.hpp"
namespace reshade::d3d11
{
class runtime_impl : public api::api_object_impl<IDXGISwapChain *, runtime>
{
... |
ZachHembree/reshade | source/QuakeFX/qfx_dynamic_collections.hpp | #ifndef QFX_DYNAMIC_COLLECTIONS_H
#define QFX_DYNAMIC_COLLECTIONS_H
#include<vector>
#include<exception>
#include<string>
namespace QuakeFX
{
template<typename T> class DynamicArrayBase;
template<typename T> class DynamicArray;
template<typename T> class UniqueArray;
/// <summary>
/// Dynamically allocated arra... |
ZachHembree/reshade | source/vulkan/runtime_vk.hpp | <reponame>ZachHembree/reshade<filename>source/vulkan/runtime_vk.hpp
/*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "runtime.hpp"
#include "render_vk.hpp"
namespace reshade::vulkan
{
class runtime_impl : public api::api_object_im... |
ZachHembree/reshade | source/QuakeFX/render/qfx_texture2D.hpp | #ifndef QFX_TEXTURE2D_H
#define QFX_TEXTURE2D_H
#include "render/qfx_image_formats.hpp"
#include "render/qfx_texture.hpp"
namespace QuakeFX
{
class QfxTexture2D : public QfxTextureBase
{
public:
QfxTexture2D(
glm::ivec2 dim = glm::ivec2(0,0),
ImageFormats internalFormat = ImageFormats::RGBA8,
PixelForma... |
ZachHembree/reshade | source/QuakeFX/render/qfx_renderer.hpp | <reponame>ZachHembree/reshade
#ifndef QFX_RENDERER_H
#define QFX_RENDERER_H
#include "qfx_runtime.hpp"
#include "render/qfx_capture_buffer.hpp"
namespace QuakeFX
{
typedef void(*CallbackPtr)();
class QfxRenderer
{
public:
static void Init(CallbackPtr callbackFunc, CallbackPtr closeCallback);
static void Clos... |
ZachHembree/reshade | source/opengl/render_gl.hpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "opengl.hpp"
#include "addon_manager.hpp"
#include <unordered_set>
namespace reshade::opengl
{
inline api::resource_handle make_resource_handle(GLenum target, GLuint object)
{
re... |
ZachHembree/reshade | source/QuakeFX/render/qfx_capture_buffer.cpp | #include "render/qfx_capture_buffer.hpp"
namespace QuakeFX
{
CaptureBuffer::CaptureBuffer() :
capturing(false),
captured(false)
{
lastDrawFbo = QfxFramebufferObj::GetCurrent(FramebufferTargs::Draw);
lastReadFbo = QfxFramebufferObj::GetCurrent(FramebufferTargs::Read);
GLuint lastVao = QfxVertexArrayObj::Ge... |
ZachHembree/reshade | source/QuakeFX/opengl/qfx_opengl.cpp | <reponame>ZachHembree/reshade
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include "hook_manager.hpp"
#include "qfx_runtime.hpp"
#include "qfx_opengl.hpp"
#include "qfx_dynamic_collections.hpp"
#define TRY_LOAD_GL( func ) if (!TryLoadGL(#func, ##func)) return false;
#define TRY_LOAD_WGL(... |
ZachHembree/reshade | source/QuakeFX/render/qfx_shader.hpp | <reponame>ZachHembree/reshade
#ifndef QFX_SHADER_H
#define QFX_SHADER_H
#include <string>
#include "opengl/qfx_opengl.hpp"
namespace QuakeFX
{
/// <summary>
/// Container for parsed shader source code
/// </summary>
struct ProgramData
{
const std::string vertexSrc;
const std::string fragmentSrc;
};
enum cl... |
ZachHembree/reshade | source/QuakeFX/render/qfx_texture.cpp | <filename>source/QuakeFX/render/qfx_texture.cpp
#include <string>
#include "render/qfx_texture.hpp"
namespace QuakeFX
{
QfxTextureBase::QfxTextureBase(uint texUnit, TexTargs target) :
id(0),
texUnit(texUnit),
target(target),
binding(GetTextureBinding(target))
{ }
QfxTextureBase::QfxTextureBase(QfxTextureBa... |
ZachHembree/reshade | source/QuakeFX/render/qfx_render_buffer.hpp | #ifndef QFX_RENDER_BUFFER_H
#define QFX_RENDER_BUFFER_H
#include "opengl/qfx_opengl.hpp"
#include "render/qfx_image_formats.hpp"
namespace QuakeFX
{
class QfxRenderBuffer
{
public:
QfxRenderBuffer(
ImageFormats internalFormat = ImageFormats::RGBA8,
glm::ivec2 dim = glm::ivec2(0,0),
int samples = 0
);
... |
ZachHembree/reshade | source/QuakeFX/render/qfx_shader.cpp | #include "render/qfx_shader.hpp"
#include <string>
namespace QuakeFX
{
using std::string;
using std::stringstream;
using std::ifstream;
/// <summary>
/// QfxShader default constructor
/// </summary>
QfxShader::QfxShader() :
id(0),
type(ShaderType::Invalid)
{ }
/// <summary>
/// Initializes a new shader... |
ZachHembree/reshade | source/d3d12/render_d3d12.hpp | <filename>source/d3d12/render_d3d12.hpp
/*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "com_ptr.hpp"
#include "com_tracking.hpp"
#include "addon_manager.hpp"
#include <d3d12.h>
#include <dxgi1_5.h>
#include <unordered_map>
namesp... |
ZachHembree/reshade | source/QuakeFX/render/qfx_vertex_layout.hpp | #ifndef QFX_VERTEX_LAYOUT_H
#define QFX_VERTEX_LAYOUT_H
#include "opengl/qfx_opengl.hpp"
#include "qfx_dynamic_collections.hpp"
namespace QuakeFX
{
enum class BufferDataTypes
{
// Attrib and Attrib I
Byte = GL_BYTE,
UnsignedByte = GL_UNSIGNED_BYTE,
Short = GL_SHORT,
UnsignedShort = GL_UNSIGNED_SHORT,
In... |
ZachHembree/reshade | source/QuakeFX/render/qfx_vertex_array_obj.cpp | #include "render/qfx_vertex_layout.hpp"
#include "render/qfx_vertex_array_obj.hpp"
namespace QuakeFX
{
void QfxVertexArrayObj::Validate() const
{
#ifndef NDEBUG
if (!IsBound())
REPORTERROR("Vertex array objects must be bound before they can be used.")
#endif // !NDEBUG
}
/// <summary>
/// Initializes a new ... |
ZachHembree/reshade | source/d3d12/d3d12.cpp | /*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "dll_log.hpp"
#include "hook_manager.hpp"
#include "d3d12_device.hpp"
HOOK_EXPORT HRESULT WINAPI D3D12CreateDevice(
IUnknown *pAdapter,
D3D_FEATURE_LEVEL MinimumFeatureLevel,
REFIID riid,
void... |
ZachHembree/reshade | source/opengl/opengl_hooks.hpp | <gh_stars>0
/*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include <GL/gl3w.h>
#undef glBindBuffer
extern "C" void WINAPI glBindBuffer(GLenum target, GLuint buffer);
#undef glBindFramebuffer
extern "C" void WINAPI glBindFramebuffer(GLenum target, GLui... |
ZachHembree/reshade | source/QuakeFX/qfx_runtime.hpp | <gh_stars>0
#ifndef QFX_RUNTIME_H
#define QFX_RUNTIME_H
#include <string.h>
#include <unordered_set>
#include <addon_manager.hpp>
#include "qfx_opengl.hpp"
#include "qfx_main.hpp"
// Yes, I'm exposing an internal global. Don't @ me.
extern thread_local reshade::opengl::runtime_impl* g_current_runtime;
namespace Quake... |
ZachHembree/reshade | source/vulkan/render_vk_utils.hpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
namespace reshade::vulkan
{
auto convert_usage_to_access(api::resource_usage state) -> VkAccessFlags;
auto convert_usage_to_image_layout(api::resource_usage state) -> VkImageLayout;
auto convert_usage_to... |
ZachHembree/reshade | source/d3d12/runtime_d3d12.hpp | /*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "runtime.hpp"
#include "render_d3d12.hpp"
namespace reshade::d3d12
{
class runtime_impl : public api::api_object_impl<IDXGISwapChain3 *, runtime>
{
public:
runtime_impl(device_i... |
ZachHembree/reshade | source/QuakeFX/qfx_runtime.cpp | <reponame>ZachHembree/reshade<filename>source/QuakeFX/qfx_runtime.cpp
#include <stdio.h>
#include <string.h>
#include <fstream>
#include <wtypes.h>
#include <mutex>
#include <tgmath.h>
#include <imgui.h>
#include <dll_config.hpp>
#include <dll_log.hpp>
#include "qfx_runtime.hpp"
#include "render/qfx_renderer.hpp"
#incl... |
ZachHembree/reshade | source/QuakeFX/opengl/qfx_opengl.hpp | #ifndef QFX_OPENGL_H
#define QFX_OPENGL_H
#include <opengl/opengl.hpp>
#include <opengl/runtime_gl.hpp>
#include <GL/GLU.h>
#include <wingdi.h>
#include <glm/glm.hpp>
#include <GL/glext.h>
#include <GL/wglext.h>
#include <exception>
#if NDEBUG
#define GLCALL(x) {x;}
#define REPORTERROR(error) {}
#elif RESHADE_TEST_AP... |
ZachHembree/reshade | source/d3d11/render_d3d11_utils.cpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "render_d3d11.hpp"
#include "render_d3d11_utils.hpp"
using namespace reshade::api;
static inline void convert_usage_to_bind_flags(const resource_usage usage, UINT &bind_flags)
{
if ((usage & res... |
ZachHembree/reshade | include/reshade_events.hpp | <gh_stars>0
/*
* Copyright (C) 2021 <NAME>
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "reshade_api.hpp"
namespace reshade
{
enum class addon_event
{
/// <summary>
/// Called after 'IDirect3D9::CreateDevice(Ex)', 'D3D10CreateDevice(AndSwapChain)', 'D3D11CreateDevice(AndSwa... |
ZachHembree/reshade | source/opengl/runtime_gl.hpp | <gh_stars>0
/*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "runtime.hpp"
#include "render_gl.hpp"
#include "state_block_gl.hpp"
namespace reshade::opengl
{
class runtime_impl : public runtime, public device_impl
{
public:
ru... |
ZachHembree/reshade | source/d3d11/render_d3d11_utils.hpp | <reponame>ZachHembree/reshade<filename>source/d3d11/render_d3d11_utils.hpp
/*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
namespace reshade::d3d11
{
void convert_resource_desc(const api::resource_desc &desc, D3D11_BUFFER_DESC &internal_desc);
void con... |
ZachHembree/reshade | source/QuakeFX/opengl/qfx_opengl_hooks.cpp | #include <hook_manager.hpp>
#include "qfx_runtime.hpp"
#include "render/qfx_renderer.hpp"
#define IS_3D_PROJECTION_MATRIX(x) (x[2*4+3] < 0)
#define MATRIXMODE RENDERER->GetLastMatrixMode()
#define RENDERER QfxRenderer::GetInstance()
using namespace reshade;
using namespace QuakeFX;
HOOK_EXPORT void WINAPI qfx_glMat... |
ZachHembree/reshade | source/QuakeFX/render/qfx_framebuffer_obj.cpp | <reponame>ZachHembree/reshade<filename>source/QuakeFX/render/qfx_framebuffer_obj.cpp
#include "render/qfx_framebuffer_obj.hpp"
namespace QuakeFX
{
QfxFramebufferObj::QfxFramebufferObj() :
id(0),
target(FramebufferTargs::Invalid)
{
glGenFramebuffers(1, &id);
}
QfxFramebufferObj::~QfxFramebufferObj()
{
if ... |
ZachHembree/reshade | source/QuakeFX/render/qfx_texture.hpp | <filename>source/QuakeFX/render/qfx_texture.hpp
#ifndef QFX_TEXTURE_H
#define QFX_TEXTURE_H
#include <glm/glm.hpp>
#include "opengl/qfx_opengl.hpp"
namespace QuakeFX
{
enum class TexTargs
{
Invalid = -1,
OneD = GL_TEXTURE_1D,
TwoD = GL_TEXTURE_2D,
ThreeD = GL_TEXTURE_3D,
OneDArray = GL_TEXTURE_1D_ARRAY,
... |
ZachHembree/reshade | source/d3d12/render_d3d12_utils.cpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "render_d3d12.hpp"
#include "render_d3d12_utils.hpp"
using namespace reshade::api;
D3D12_RESOURCE_STATES reshade::d3d12::convert_resource_usage_to_states(reshade::api::resource_usage usage)
{
au... |
ZachHembree/reshade | source/QuakeFX/qfx_hook_manager.hpp | #ifndef QFX_HOOKS_H
#define QFX_HOOKS_H
#include <windows.h>
#include <vector>
namespace std
{
template<typename K, typename V>
struct pair;
class mutex;
}
namespace QuakeFX
{
typedef void (*CallbackFunc)();
struct ModuleExport
{
void* address;
const char* name;
unsigned short ordinal;
ModuleExport()... |
ZachHembree/reshade | source/d3d9/runtime_d3d9.cpp | /*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "dll_log.hpp"
#include "runtime_d3d9.hpp"
#include "runtime_d3d9_objects.hpp"
#include <d3dcompiler.h>
reshade::d3d9::runtime_impl::runtime_impl(device_impl *device, IDirect3DSwapChain9 *swapchain... |
ZachHembree/reshade | source/QuakeFX/render/qfx_program.cpp | <filename>source/QuakeFX/render/qfx_program.cpp
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include "render/qfx_program.hpp"
namespace QuakeFX
{
using std::string;
using std::stringstream;
using std::ifstream;
ProgramData GetParsedShaderSrc(const string& source);
QfxProgram::Qfx... |
ZachHembree/reshade | source/QuakeFX/render/qfx_vertex_array_obj.hpp | <reponame>ZachHembree/reshade<gh_stars>0
#ifndef QFX_VERTEX_ARRAYOBJ_H
#define QFX_VERTEX_ARRAYOBJ_H
#include "opengl/qfx_opengl.hpp"
#include "qfx_dynamic_collections.hpp"
namespace QuakeFX
{
class QfxVertexLayout;
class QfxVertexArrayObj
{
public:
/// <summary>
/// Initializes a new vertex array object. Un... |
ZachHembree/reshade | source/d3d11/render_d3d11.hpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "com_ptr.hpp"
#include "com_tracking.hpp"
#include "addon_manager.hpp"
#include <d3d11_4.h>
namespace reshade::d3d11
{
class device_impl : public api::api_object_impl<ID3D11Device *... |
ZachHembree/reshade | source/QuakeFX/qfx_main.hpp | <reponame>ZachHembree/reshade
#ifndef QFX_MAIN_H
#define QFX_MAIN_H
#pragma warning( disable : 4100 )
#include <cassert>
#include <cstdio>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <windows.h>
#include <mmsystem.h>
const char *const QFX_LIBRARY_TITLE = "QuakeFX";
#endif //Q... |
ZachHembree/reshade | source/QuakeFX/qfx_hook_manager.cpp | #include <hook_manager.hpp>
#include <mutex>
#include <utility>
#include "qfx_dynamic_collections.hpp"
#include "qfx_main.hpp"
#include "qfx_runtime.hpp"
#include "qfx_hook_manager.hpp"
using namespace reshade;
HMODULE WINAPI HookLoadLibraryA(LPCSTR lpFileName);
HMODULE WINAPI HookLoadLibraryExA(LPCSTR lpFileName, HA... |
ZachHembree/reshade | source/d3d9/render_d3d9_utils.hpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
namespace reshade::d3d9
{
void convert_resource_usage_to_d3d_usage(const api::resource_usage usage, DWORD &d3d_usage);
void convert_d3d_usage_to_resource_usage(const DWORD d3d_usage, api::resource_usage &... |
ZachHembree/reshade | source/QuakeFX/render/qfx_render_buffer.cpp | <filename>source/QuakeFX/render/qfx_render_buffer.cpp
#include "render/qfx_render_buffer.hpp"
using namespace glm;
namespace QuakeFX
{
QfxRenderBuffer::QfxRenderBuffer(
ImageFormats internalFormat,
ivec2 dim,
int samples
) :
id(0),
internalFormat(internalFormat),
dim(dim),
samples(0)
{
glGenRenderb... |
ZachHembree/reshade | source/QuakeFX/render/qfx_program.hpp | <reponame>ZachHembree/reshade<gh_stars>0
#ifndef QFX_PROGRAM_H
#define QFX_PROGRAM_H
#include <glm/glm.hpp>
#include <unordered_map>
#include "opengl/qfx_opengl.hpp"
#include "qfx_dynamic_collections.hpp"
#include "render/qfx_shader.hpp"
namespace QuakeFX
{
enum class ProgramParameters
{
/// <summary>
/// Retur... |
ZachHembree/reshade | source/opengl/render_gl.cpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "render_gl.hpp"
#include "render_gl_utils.hpp"
#include <cassert>
static inline GLenum get_binding_for_target(GLenum target)
{
switch (target)
{
default:
return GL_NONE;
case GL_ARRAY_BUFFER... |
ZachHembree/reshade | source/QuakeFX/render/qfx_buffer.hpp | #ifndef QFX_GLBUFFER_H
#define QFX_GLBUFFER_H
#include "opengl/qfx_opengl.hpp"
#include "qfx_dynamic_collections.hpp"
namespace QuakeFX
{
enum class BufferContextBinding
{
Invalid = -1,
/// <summary>
/// Vertex attribute buffer binding
/// </summary>
ArrayBuffer = GL_ARRAY_BUFFER_BINDING,
/// <summary... |
ZachHembree/reshade | source/QuakeFX/render/qfx_image_formats.hpp | #ifndef QFX_COLOR_FORMATS_H
#define QFX_COLOR_FORMATS_H
#include "opengl/qfx_opengl.hpp"
namespace QuakeFX
{
/// <summary>
/// Used to specify format of pixel data used by images.
/// </summary>
enum class PixelFormats
{
BGRA = GL_BGRA,
BGRA_I = GL_BGRA_INTEGER,
BGR_I = GL_... |
ZachHembree/reshade | source/QuakeFX/render/qfx_vertex_layout.cpp | <filename>source/QuakeFX/render/qfx_vertex_layout.cpp
#include <string>
#include "render/qfx_vertex_layout.hpp"
namespace QuakeFX
{
/// <summary>
/// Returns the size of the vertex element specified by the struct.
/// </summary>
uint QfxVertexElement::GetSize() const
{
return count * GetTypeSize(type);
}
///... |
ZachHembree/reshade | source/addon_manager.hpp | <gh_stars>0
/*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "addon_impl.hpp"
#include "reshade_events.hpp"
#include <string>
#if RESHADE_ADDON
#define RESHADE_ADDON_EVENT(name, ...) \
for (size_t cb = 0; cb < reshade::addon::ev... |
ZachHembree/reshade | source/openvr/openvr.cpp | /*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "dll_log.hpp"
#include "hook_manager.hpp"
#include "d3d11/d3d11_device.hpp"
#include "d3d11/d3d11_device_context.hpp"
#include "d3d11/runtime_d3d11.hpp"
#include "d3d12/d3d12_device.hpp"
#include "... |
ZachHembree/reshade | source/QuakeFX/qfx_main.cpp | <reponame>ZachHembree/reshade
#include <hook_manager.hpp>
#include "qfx_main.hpp"
#include "qfx_runtime.hpp"
#include "qfx_hook_manager.hpp"
using namespace reshade;
using namespace QuakeFX;
void InitCallback();
#ifdef RESHADE_TEST_APPLICATION
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR l... |
ZachHembree/reshade | source/QuakeFX/render/qfx_buffer.cpp | #include <string>
#include "render/qfx_buffer.hpp"
namespace QuakeFX
{
/// <summary>
/// Initializes an empty, invalid buffer wrapper.
/// </summary>
QfxBuffer::QfxBuffer() :
id(0),
target(BufferBindingTargets::Invalid),
binding(BufferContextBinding::Invalid),
pattern(BufferUsagePatterns::Invalid)
{ }
/... |
ZachHembree/reshade | source/QuakeFX/render/qfx_renderer.cpp | #include <hook_manager.hpp>
#include <vector>
#include <string>
#include <imgui.h>
#include "render/qfx_renderer.hpp"
#include "qfx_default_shader.hpp"
#include "qfx_hook_manager.hpp"
#define CFG QfxRuntime::GetConfig()
using namespace reshade;
using namespace glm;
typedef ImDrawData* (*ImDrawDataPtr)();
HOOK_EXPO... |
ZachHembree/reshade | source/d3d10/render_d3d10.hpp | <gh_stars>0
/*
* Copyright (C) 2021 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#pragma once
#include "com_ptr.hpp"
#include "com_tracking.hpp"
#include "addon_manager.hpp"
#include <d3d10_1.h>
namespace reshade::d3d10
{
class device_impl : public api::api_object_impl<ID... |
ZachHembree/reshade | source/vulkan/runtime_vk_objects.hpp | <filename>source/vulkan/runtime_vk_objects.hpp
/*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "runtime_objects.hpp"
namespace reshade::vulkan
{
struct tex_data
{
VkImage image = VK_NULL_HANDLE;
VkImageView view[4] = {};
VmaAllocation i... |
ZachHembree/reshade | source/QuakeFX/render/qfx_texture2D.cpp | #include "render/qfx_texture2D.hpp"
namespace QuakeFX
{
QfxTexture2D::QfxTexture2D(
glm::ivec2 dim,
ImageFormats internalFormat,
PixelFormats format,
PixelTypes pixType,
GLint lod,
TexInterpFuncs minInterp,
TexInterpFuncs magInterp,
TexWrapPatterns wrapS,
TexWrapPatterns wrapT,
GLvoid* imgData
) ... |
ZachHembree/reshade | source/vulkan/runtime_vk.cpp | <filename>source/vulkan/runtime_vk.cpp
/*
* Copyright (C) 2014 <NAME>. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "dll_log.hpp"
#include "runtime_vk.hpp"
#include "runtime_vk_objects.hpp"
#include "format_utils.hpp"
static inline void transition_layout(const VkLayerDispa... |
Wongboo/color | example/color_zh.cpp | <gh_stars>1-10
#include "color_ostream.h"
using namespace color_ostream;
using namespace std;
int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) {
wcout << clr::red << L" red "
<< clr::yellow << L" yellow "
<< clr::green << L" green "
<< clr::cyan ... |
Wongboo/color | example/color.cpp | <filename>example/color.cpp
#include "color_ostream.h"
using namespace color_ostream;
using namespace std;
int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) {
std::cout << clr::red << " red "
<< clr::yellow << " yellow "
<< clr::green << " green "
... |
Wongboo/color | example/hello_zh.cpp | <filename>example/hello_zh.cpp
#include "color_ostream.h"
using namespace color_ostream;
int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) {
rd_wcout.imbue(std::locale(std::locale(),"",LC_CTYPE));
rd_wcout << L"你好,沃德\n";
rd_wcout << L"你好,世界\n";
rd_wcout << L"哈啰,世界\n";
rd256_wcou... |
yuikns/hello_rabbitmq | src/consumer.cc | <reponame>yuikns/hello_rabbitmq<filename>src/consumer.cc
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <amqp.h>
#include <amqp_framing.h>
//#include <amqp_ssl_socket.h>
#include <amqp_tcp_socket.h>
#include <assert.h>
#include "utils.h"
#define SUMMA... |
yuikns/hello_rabbitmq | src/producer.cc | #include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <amqp_tcp_socket.h>
#include <amqp.h>
#include <amqp_framing.h>
#include "utils.h"
#define SUMMARY_EVERY_US 1000000
static void send_batch(amqp_connection_state_t conn,
char const *queue_name,
int rate_l... |
yuikns/hello_rabbitmq | lib/argcvnw/argcvhttp.cc | <filename>lib/argcvnw/argcvhttp.cc
#include "argcvhttp.h"
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#ifndef ARGCV_DEFAULT_FILE
#define ARGCV_DEFAULT_FILE "/"
#endif // ARGCV_DEFAULT_FILE
#ifndef ARGCV_DEFAULT_HTTP_PROTOCOL
#define ARGCV_DEFAULT_HTTP_PROTOCOL 0
#endif // ARGCV_DEFAULT_... |
mmaldacker/Vortex2D | Vortex/Renderer/RenderWindow.cpp | <gh_stars>100-1000
//
// RenderWindow.cpp
// Vortex
//
#include "RenderWindow.h"
#include <Vortex/Renderer/CommandBuffer.h>
#include <Vortex/Renderer/Drawable.h>
namespace Vortex
{
namespace Renderer
{
struct SwapChainSupportDetails
{
SwapChainSupportDetails(vk::PhysicalDevice device, vk::SurfaceKHR surface)
... |
mmaldacker/Vortex2D | Vortex/Engine/LinearSolver/Reduce.cpp | //
// Reduce.cpp
// Vortex
//
#include "Reduce.h"
#include <Vortex/Renderer/DescriptorSet.h>
#include <Vortex/Renderer/Work.h>
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
namespace
{
Renderer::ComputeSize MakeComputeSize(int size)
{
Renderer::ComputeSize computeSize(Renderer::Comput... |
mmaldacker/Vortex2D | Vortex/Engine/Particles.cpp | //
// Particles.cpp
// Vortex
//
#include "Particles.h"
#include <Vortex/Engine/LevelSet.h>
#include <random>
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
float DefaultParticleSize()
{
return 1.0f / std::sqrt(2.0f);
}
ParticleCount::ParticleCount(Renderer::Device& device,
... |
mmaldacker/Vortex2D | Vortex/Engine/Extrapolation.cpp | //
// Extrapolation.cpp
// Vortex
#include "Extrapolation.h"
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
Extrapolation::Extrapolation(Renderer::Device& device,
const glm::ivec2& size,
Renderer::GenericBuffer& valid,
... |
mmaldacker/Vortex2D | Vortex/Renderer/Buffer.cpp | <filename>Vortex/Renderer/Buffer.cpp
//
// Buffer.cpp
// Vortex
//
#include "Buffer.h"
#include <Vortex/Renderer/CommandBuffer.h>
#include <Vortex/Renderer/Device.h>
#include <Vortex/Renderer/Texture.h>
namespace Vortex
{
namespace Renderer
{
void BufferBarrier(vk::Buffer buffer,
vk::CommandBuff... |
mmaldacker/Vortex2D | Tests/Engine/ExtrapolateTests.cpp | <filename>Tests/Engine/ExtrapolateTests.cpp
//
// ExtrapolateTests.cpp
// Vortex
//
#include <Vortex/Engine/Extrapolation.h>
#include "VariationalHelpers.h"
#include "Verify.h"
using namespace Vortex::Fluid;
using namespace Vortex::Renderer;
extern Device* device;
void PrintValid(const glm::ivec2& size, Vortex::R... |
mmaldacker/Vortex2D | Vortex/Engine/PrefixScan.cpp | <filename>Vortex/Engine/PrefixScan.cpp<gh_stars>100-1000
//
// PrefixScan.cpp
// Vortex
//
#include "PrefixScan.h"
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
namespace
{
int GetWorkGroupSize(int n, int localSize)
{
return (n + (localSize * 2 - 1)) / (localSize * 2);
}
Renderer::Com... |
mmaldacker/Vortex2D | Vortex/Engine/World.cpp | //
// World.cpp
// Vortex
//
#include "World.h"
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/transform.hpp>
namespace Vortex
{
namespace Fluid
{
template <typename Class>
void ForAll(std::vector<Class*>& elements, void (Class::*f)())
{
for (auto& element : elements)
{
(*(element).*f)();
}
}
uint32_... |
mmaldacker/Vortex2D | Vortex/Engine/LinearSolver/ConjugateGradient.cpp | <gh_stars>100-1000
//
// ConjugateGradient.cpp
// Vortex
//
#include "ConjugateGradient.h"
#include <Vortex/Engine/Rigidbody.h>
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
ConjugateGradient::ConjugateGradient(Renderer::Device& device,
const glm::iv... |
mmaldacker/Vortex2D | Vortex/Renderer/Texture.cpp | //
// Texture.cpp
// Vortex
//
#include "Texture.h"
#include <Vortex/Renderer/CommandBuffer.h>
#include <Vortex/Renderer/Device.h>
namespace Vortex
{
namespace Renderer
{
vk::DeviceSize GetBytesPerPixel(vk::Format format)
{
switch (format)
{
case vk::Format::eR8Uint:
case vk::Format::eR8Sint:
ret... |
mmaldacker/Vortex2D | Tests/Renderer/RenderingTests.cpp | //
// RenderingTests.cpp
// Vortex
//
#include <gtest/gtest.h>
#include <Vortex/Renderer/CommandBuffer.h>
#include <Vortex/Renderer/RenderTexture.h>
#include <Vortex/Renderer/Shapes.h>
#include <Vortex/Renderer/Sprite.h>
#include <Vortex/Renderer/Texture.h>
#include "ShapeDrawer.h"
#include "Verify.h"
using names... |
mmaldacker/Vortex2D | Vortex/Engine/Boundaries.cpp | <reponame>mmaldacker/Vortex2D<gh_stars>100-1000
//
// Boundaries.cpp
// Vortex
//
#include "Boundaries.h"
#include <Vortex/Engine/LevelSet.h>
#include <Vortex/Engine/Particles.h>
#include <Vortex/SPIRV/Reflection.h>
#include "vortex_generated_spirv.h"
namespace Vortex
{
namespace Fluid
{
namespace
{
bool IsClockw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.