Categories
Game Creation Mastering Development

SDL2 Application RAM Usage

I am developing a game that uses SDL2, SDL2 Image & SDL2 TTF, while using clang compiler under Linux. When running it in release mode(compiler flags: -Wall -O3) there is a constant usage of about 52MB, I’ve checked with Valgrind for memory leaks and there are none. My Game class: #include “Game.h” Game::Game(Configurations configurations) { […]

Categories
Mastering Development

Cannot resume process created by NtCreateProcessEx

Here im trying to create and run calc but the process is created in suspended state. This is the main code: #include <Windows.h> #include <iostream> using namespace std; #define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 ) typedef struct _LSA_UNICODE_STRING { USHORT Length; USHORT MaximumLength; PWSTR Buffer; } LSA_UNICODE_STRING, * PLSA_UNICODE_STRING, UNICODE_STRING, * PUNICODE_STRING; typedef struct _OBJECT_ATTRIBUTES { […]

Categories
Mastering Development

Ignore common name when verifiying certificate in openssl

We are writing a new server/client app and need to Verify self-signed certificates in OpenSSL 1.1.0 where CN field isn’t important. I tried to do the following but it doesn’t seem to have an effect: X509_VERIFY_PARAM *param = NULL; param = SSL_get0_param(sslo.ssl); X509_VERIFY_PARAM_set1_host(param, nullptr, 0); How can I effectivly ignore all verification of this field? […]

Categories
Development Game Creation

Debug in OpenGL & GLFW (version >= 4.3)

I try enable debug system in OpenGL with helps debug output in OpenGL version >= 4.3. My code: void GLAPIENTRY glDebugOutput(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) { } int main() { glfwInit(); GLFWwindow* window = glfwCreateWindow(800, 600, “TestGL”, nullptr, nullptr); glfwMakeContextCurrent(window); glfwSetKeyCallback(window, key_callback); glewExperimental = […]

Categories
Development

Why the texture created from the framebuffer is not mapping correctly

I am creating a custom framebuffer of size 1920 X 1080 and then mapping the texture of this frame buffer to a full screen rectangle in default frame buffer of size 800 X 600. I had drawn a rectangle in the center of the screen in the custom frame buffer and after mapping the texture […]

Categories
Development

Getting access violation while creating logical devices

I get the following error: Exception thrown at VkLayer_khronos_validation.dll Exception thrown at 0x00007FFA5252DD05 (VkLayer_khronos_validation.dll) Access violation reading location 0xFFFFFFFFFFFFFFFF. My code: void LogicalDevice::createLogicalDevice(VkPhysicalDevice pDevice){ VkDeviceQueueCreateInfo qcreateInfo; qcreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; QueueFamiliesIndices indices = PhysicalDevice::findQueueFamilies(pDevice); qcreateInfo.queueFamilyIndex = indices.graphicsFamily.value(); qcreateInfo.queueCount = 1; float queuePriority = 1.0f; qcreateInfo.pQueuePriorities = &queuePriority; VkPhysicalDeviceFeatures deviceFeatures = {}; VkDeviceCreateInfo createInfo = {}; createInfo.sType […]

Categories
Development

CreateDIBSection returns inconsistent bitmap bit values for the same image

This is an extended question about CreateDIBSection. I used it to get the bitMap bit value of the same image which drawn using Direct3D, to verify its consistency of Direct3D rendering, i.e. as long as I get the same bitMap bit value every time I run the program (draw the same image), then I consider […]

Categories
Development

Listing of installed apps on Windows 10

I am trying to programmatically list all the installed app on my win10 system. Basically, I am trying to get the list that you can see when you type “shell:appsFolder” in an explorer window. Here is the code that I use: HRESULT hr; IShellFolder *psParent= nullptr, *psApps= nullptr; LPITEMIDLIST pidlSystem = NULL; hr = SHGetFolderLocation(NULL, […]

Categories
Development

AVL tree implementation using non recursive insert method

I’m learning to implement AVL tree and I’m stuck… Trying to implement Insert function non-recursively. it’s been 3 days already and I’m lost. Here is my code… Hope someone can help me #include <iostream> using namespace std; class Node{ // WORKS public: Node *left, *right, *parent; int elem, height; Node(Node* l, Node* r, Node* […]

Categories
Development

FT_Glyph_To_Bitmap fails with Raster_Overflow after using FT_Glyph_StrokeBorder

I’ve been trying to get a stroke effect around my text using freetype2. I’ve attempted to follow some example usages of FT_Glyph_StrokeBorder, however whenever I call FT_Glyph_To_Bitmap (after stroking) error code Raster_Overflow is returned (note in earlier versions of freetype Array_too_large was returned). I can’t find much on what these error codes mean or what […]