#Creating a window & getting it's framebuffer?

23 messages · Page 1 of 1 (latest)

lofty dock
#

I'm trying to write a small raytracing engine in C, and I require a framebuffer to do so. How can I create a window using the Win32 API and get it's framebuffer? I can't and do not want to use any libraries such as GLFW or SDL.

runic knotBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

eager cairn
#

any reason why you dont want to use those ?
you normally use a graphics library and just render to a texture

#

those are approx. less than 50 lines of code in SDL2

sour spruce
#

You'll have to translate some c++ code to c code though

dull granite
#

In very broad terms, you would create the window with CreateWIndowEx() which will return a handle to the window (HWND). When it comes time to draw on this window, you would obtain a handle to a device context for the window with HDC hdc = GetDC(hwnd); This device context would then be used with all the drawing primatives to actually modify the window's frame buffer. When done drawing you would release the device context with ReleaseDC(hwnd, hdc);

lofty dock
eager cairn
#

?

lofty dock
lofty dock
eager cairn
#

what has the version to do with anything

lofty dock
#

i added it as a submodule

#

and linked with it in CMake

#

a lot of things were renamed

eager cairn
#

then read the migration guide

#

Ctrl+F thing_that_might_have_changed

#

also you can totally just use SDL2

#

nothing requires you to use 3

lofty dock
#

Going to use MiniFB instead

#

great library btw