Category : direct2d

HWND graph::createwindow() { FreeConsole(); glfwInit(); glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE); GLFWmonitor* monitor = glfwGetPrimaryMonitor(); const GLFWvidmode* mode = glfwGetVideoMode(monitor); glfwWindowHint(GLFW_RED_BITS, mode->redBits); glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); window = glfwCreateWindow(mode->width, mode->height, "GLFW", monitor, nullptr); return glfwGetWin32Window(window); } I am trying to use glfw with direct2d. I wrote ..

Read more

We are migrating from GDI based printing to D2D based printing. With GDI based printing we used SaveDC and RestoreDC functions to save the state of device context. What is the equivalent of these in D2D. We tried using stack of D2D layers and replaying back on RestoreDC but the performance is not acceptable. Source: ..

Read more

An issue with Microsoft’s Direct2D framework. How is it possible that width > widthIncludingTrailingWhitespace? Shouldn’t it be width == widthIncludingTrailingWhitespace in the case of no trailing spaces and width < widthIncludingTrailingWhitespace. when the underlying string contains trailing spaces? In my case the underlying string is " Info ". It has a trailing space in it ..

Read more

Each frame is created and some kind of texture is destroyed. All this happens if you use it once ID2D1RenderTarget-> FillGeometry Example experiment: #include "windows.h" #include <d2d1.h> #include <wrl.h> using Microsoft::WRL::ComPtr; template <class T> void SafeRelease(T **ppT){ if (*ppT){ (*ppT)->Release(); *ppT = NULL; } } HWND windowHandle; ID2D1Factory *d2Factory; ID2D1HwndRenderTarget *renderTarget; ID2D1Bitmap* geometryCache = nullptr; ..

Read more

I have a program that is constantly receiving about 60 jpeg files per second in memory, and I’m trying to convert each image into a ID2D1Bitmap. Here is what I’m doing right now: HRESULT DemoApp::LoadBitmapFromBytes(BYTE* bytes, DWORD length, ID2D1Bitmap** bitmap) { IWICBitmapDecoder* pDecoder = NULL; IWICBitmapFrameDecode* pSource = NULL; IWICStream* pStream = NULL; IWICFormatConverter* pConverter ..

Read more

I have a program that is constantly receiving about 60 jpeg files in memory, per second, and as bytes, and I’m looking to use d2d to simply create a bitmap from that in memory jpeg data, and then render it onto the screen. What is the most efficient way to do this? Basically I’m looking ..

Read more

I’m looking to import 360 videos into my video sequencer with the ability to change the view port at runtime. For sample, I downloaded this vimeo video: https://vimeo.com/215984568. As far as I understand technically, this is a common H264/H265 format which reads as such in my application already: So as I get it, it’s all ..

Read more