c - SetPixel equivalent on mac? -
I am currently writing a software renderer and found it after working on windows, about starting it Mack started thinking about
My question is: What is the equivalent of Win32 GDI SetPixel function? Plot a pixel on what I should be able to do (x, y).
I'm new to Mac development and the closest thing I got as an answer was to use the OpenLeal texture to attract one.
Is it possible to plot single pixels in OSX is?
short answer
Simply use LibSDL (preferably version 2.0).
Long answer
You have to take your pixel data from system memory to graphics memory. One way to do this is with OpenGL, you can think of OpenGL as a fancy API That lets you push data to system memory from system memory. It's okay to use OpenGL.
But if I want to use OpenGL then the issue of rendering such software is defeated ...
Graphics card Whether you like it or not you can not get any special portability benefits to avoid OpenGL, whether it is composing your pixels on the screen. Back in the 90's you could get a pointer to the framebuffer and push the pixels there, but that day has gone.
LibsdL is good because it gives you an API that lets you drag pixels into buffer, and then takes care of buffer on LibSDL screen.
SetPixel ()
is very slow, so you should use LibSDL on Windows.
अन्य ऑब्जेक्ट को एक ऑब्जेक्ट प्रकार के रूप में घोषित किया गया है, इसलिए इसमें नहीं है जो भी वर्ग आपने बनाया है, उसके गुणों में से कोई भी। यह उस वस्तु के समान होना चाहिए, जिस वस्तु को आप इसके साथ तुलना करने की कोशिश कर रहे हैं।