Making graphic API's

Pages: 12
May 25, 2010 at 7:31am
Hi all

I was just wondering how people like Microsoft create APIs like win32 isit OpenGL?
May 25, 2010 at 8:09am
Win32 isn't an API, is a nickname for 32-bit versions of Windows. Maybe you're talking about the Windows API. In which case, it's part of the OS.

The software part of OpenGL works by sending commands to the hardware through its drivers. Most of the work is done by the hardware.
Some OpenGL implementations provide software rendering, in which case the CPU does all the work of managing the finite state machine, rendering primitives, and so on. Unless I'm mistaken about their workings, they only output to temporary buffers and it's up to the programmer to decide where to send the rendered picture. It could be a file, it could be a window, or something entirely different altogether.

Does that answer your question? Or did you want to know something more specific, such as how are graphics displayed on the screen?
May 25, 2010 at 2:44pm
It is worth pointing out that, for years, the Windows API was called Win32, and many people still use the name. Even the documentation still refers to it occasionally as Win32. For instance:

"The Win32 API (also known as the Windows API) is a C-based framework for creating Windows applications, and has been around since Windows 1.0." (http://msdn.microsoft.com/en-us/library/bb384843.aspx)
May 25, 2010 at 4:00pm
Thanks for the replies but yeah i'm wondering more how you accutaly display the windows on the screen. Is it programmed or what
May 25, 2010 at 5:24pm
It is worth pointing out that, for years, the Windows API was called Win32, and many people still use the name.


I've never seen 'Win32' refer to anything other than 32-bit Windows.

For instance:

"The Win32 API


Bolded part for emphasis.

It's not using "Win32" to refer to the API, it's using "Win32 API" to refer to the API.

I've also seen it called "WinAPI"

</splitting hairs>
May 25, 2010 at 6:55pm
I stand corrected. Sorry about the mixup.

For what it's worth, I have seen people referring to Win32 API simply as "Win32"; as an example, wikipedia redirects "Win32" to "Windows API", rather than "Windows" or "32-bit Windows".
May 25, 2010 at 8:05pm
Well.. Yes - now that we've got Win32 abbrevations all cleared up - let's move on to the question shall we? ;)

I'm rather interested in how it works myself.
May 25, 2010 at 8:10pm
Thanks for the replies but yeah i'm wondering more how you accutaly display the windows on the screen.
The system writes pixels to video memory and the hardware sends signals to the monitor.
That's for strictly 2D windowing systems. If there's compositing going on, it's much more complex. The system writes pixels to textures stored in hardware and different commands are sent to the hardware to produce different effects. For example, the "wobbly windows" effect that can be seen in Compiz is achieved by splitting the windows into a mesh the size of the window and transforming the polygons in it to give the appearance that the window is bending.
May 25, 2010 at 8:10pm
I thought helios gave a pretty solid answer in his reply.

APIs simply interface with another (typically lower level) API, or they communicate directly with the hardware.
May 25, 2010 at 8:13pm
Well said anglehoof but how do you write the pixels to memory is it assembly or what
Last edited on May 25, 2010 at 8:14pm
May 25, 2010 at 8:16pm
Oops sorry didn't see dischs post about it be at a low level
Last edited on May 25, 2010 at 8:41pm
May 25, 2010 at 8:46pm
Guys I don't want to sound like a tube but I am a newbie and I'm wondering how do you write the low level stuff is it assembly or c++ and if you know a good tutorial could you please point me to it cheers
May 25, 2010 at 8:55pm
What exactly are you trying to do?
May 25, 2010 at 9:04pm
It's possible for a program to write directly to video memory by interfacing with the display drivers, but that hasn't been done in decades for a very important reason: modern hardware is very heterogeneous. If you write something like that and get it to work properly, it will work for your hardware configuration, and your hardware configuration only.
That's why abstraction layers such as DirectX, OpenGL, and even [I can't remember the name, right now. It's that Windows API that lets programs write to windows as though they were bitmaps.] exist. To support as much hardware as possible while changing as little code as possible.

To repeat RedX's question, what are you trying to do?
May 25, 2010 at 9:11pm
I'm seconding helios' post, but I would like to point out that very low level code (drivers, OS kernels, those sorts of things) can be written using one of many Assembly languages and/or C, though C is the easier to use language. Any true Assembly language (HLA doesn't count) has a pretty sharp learning curve relative to C.

-Albatross
May 25, 2010 at 9:35pm
Well I would like to try a make a small program that has it's own graphics api like iTunes or the lg pc suite for example
May 25, 2010 at 9:36pm
iTunes doesn't use its own graphics API, it uses OpenGL. AFAIK, that is.

-Albatross
Last edited on May 25, 2010 at 9:37pm
May 25, 2010 at 9:37pm
Something basic like a clock
May 25, 2010 at 9:39pm
Okay... what you want then is a GUI/Application Development library, like QT4. If you want to create a GUI library from scratch, good luck, and you'll need to study some OpenGL.

http://qt.nokia.com/products

-Albatross
May 25, 2010 at 9:40pm
Thanks alot albatross and everyone else you've been really helpful
Pages: 12