Cgi Api?

Does anyone know if there’s a free graphics API?

~Thanks

You bet, man. OpenGL Is the best and used widly, even in commercial software, like Unreal and Maya(I think). But, it’s harder than DirectX, but that isn’t free, so nevermind. Oh, wait, DirectX is free, actually, you just can’t use it outside of Windows, and you can’t use the newer versions of DirectX with older versions of Windows.

OpenGL is actually much easier to deal with than DirectX AFAIK (I assume you are talking about comparing OGL 2.0 to DX9).

In my experience DirectX get’s very messy, very fast.

I reccomend OpenGL.

OGL is much easier than DX imho.

Yeah, I was reading “Beginning Programming for Dummies with Java” and it had an AWESOME explanation of an API.

So I’m not a coder yet, but for future reference.

So THAT’S what OpenGL/DirectX are :smiley:

Does it have stuff for menus and such?

I’m not sure, but I think OpenGL is just for hardcore graphics stuff. However I’m certain that there are many “GUI toolkits” (usually the things you need for basic menus buttons etc) that are OpenGL based, or which call to it in one way or another.

I know there is one for python at least.

I guess my question was this:

In the explanation that book gave me, basically it said an API was a collection of sub-programs/code.

It gave the analogy that the authors friend who worked for a software firm would constantly have to rewrite a search-and-replace program for updated versions of their wordprocessor.

When APIs were introduced, however, they contained little sub programs like a program that found words and a program that replaced words and such.

So my question is;

Looking at the Blender and K-3D source folders and all the files, is that what OpenGL/DirectX are; do they have smaller little programs/files[booleans, NURBS, modifiers, etc…] and the program you write calls on them?

OH, and can someone give me a laymen’s explanation of the GTK; which I think is the “Gimp toolkit”? Is that a GUI tool?

I notice for some open source programs I have to download a bunch of other stuff; like for SharpConstruct I have to GTKmm and GTK. It just bugs me when it’s not an all-in-one thing; not an all-in-one installer, but something that isn’t reliant on other things like that.

Also, I’ve been looking more into Java.

How is Blender made to be cross-platform? Is a separate build made for each platform?

Because on Java it looks like you don’t have to do that…you know, “write once, run anywhere.”

So would Java be a good thing to write a CG program in, or is it too slow because of the JVM?

Sort of, go look at some OpenGL tutorials and see how it’s used yourself.

Yes it is. Well, more specifically, it’s a widget toolkit. It allows you to add and customize widgets (which can be windows, panels, icons, buttos, etc.) to build a GUI.

Those programs can be made all-in-one, generally not including the whole set of libraries that GTK+ comes with and only what’s really needed instead. Much like Blender being distributed with it’s own Python library file which is enough to run the built-in scripts (I think), but not a complete installation of Python.

Bah,

I really can’t stand dependencies. That’s why older toolkits are so great. Even with less “shiny” features, nothing beats portability.

Are you referring to my example[SharpConstruct]?

And to my next question:

Is Java really that portable, and is it fast enough for 3D[for a renderer or graphics application]?

Yes and
NOOOOOOOOOOOOO

Java is portable, but let’s not forget that you can still package your dependencies as one if you are working with something else. All without dealing with any JVM slowdowns that might occur with a Java app.

Graphics wise, if you want to squeeze every possible drop out of your hardware you do it with Assembly AFAIK. I think that was mostly done in the 80s, before decent GPU hardware came around, then they could turn to C, because it was easier to write, and at that point the speed tradeoff became negligible anyway.

Java is ok, but for blazing performance you turn to C.

…fixed

Actually OOP code is slower AFAIK.

Two things:

  1. No it isn’t.
  2. DirectX utilizes cutting edge technology faster and it’s OOP.

google:define:API
Wikipedia:API

Looking at the Blender and K-3D source folders and all the files, is that what OpenGL/DirectX are; do they have smaller little programs/files[booleans, NURBS, modifiers, etc…] and the program you write calls on them?
OpenGL is a ‘library’ for other applications to use, to enable 3D graphic functionality. This means an API has to be present to make it feasible to use in other people’s applications. Generally the idea to an API is that developers dont need access to source code or need to understand the inner workings - you simply download someone’s ‘library’ /program and use their API to access specific functions and let the program do the hard work.

So, just because blender is made up of many little files does not necessairly mean its an “API”, infact. Since blender generally writes everything it’s self, have acccess to source code and understand the inner workings they do not need to have another program to handle this for them, so no API is needed and simply put, they can include portion of source code directly into their program to handle nurb support for a much faster, less intensive turn around.

similar to OOP, say ruby - you can have many files that handle differernt task and then call upon them - very much like an API but since it is all “one program” and not a bridge between two independant programs it’s really just a function of the original program seporated as it’s own independant object /module for ease of editing /compatability.

In the case of your book’s example - really all they done is made thier program modular (have one /file /function that can handle search and replace) so all that’s happening is the main program is exicuting the file to handle the search and replace, they could have programmed it all in one big file - but by having it in it’s own independant file it can easily be edited without having to reinstall the whole program.

the key principle of an API is that you have two applications that need to be bridged together to share each other’s functionality. When you have access to source code an api is usless, you just include the code in with yours…

How is Blender made to be cross-platform? Is a separate build made for each platform?

Because on Java it looks like you don’t have to do that…you know, “write once, run anywhere.”
I expect blender uses a cross OS toolkit /standard so that code can be complied for each OS.

So would Java be a good thing to write a CG program in, or is it too slow because of the JVM?
Many Java based CG applications, however they are rather intensive and slow even on the most basic of levels which why most large application need to be done in a language such as C, C++ etc…

Graphics wise, if you want to squeeze every possible drop out of your hardware you do it with Assembly AFAIK. I think that was mostly done in the 80s, before decent GPU hardware came around, then they could turn to C, because it was easier to write, and at that point the speed tradeoff became negligible anyway.
Games used to be programmed in assembly back then, but then again working with 8bit graphics isn’t too hard, it wasnt so much as they were trying to increase performance i think it was more to do with ASM being the only thing they could use, since you have to write a program to handle “C” in “ASM” at that primitive state most people would just stick to C untill processor /hardware got more complex.

I think you might be confusing software improvements with hardware improvements.

I still think programs written in a procedural language run faster when compared their OOP written counterparts. I mean most of the functions you call with an OOP language are far too general, and then take in account the extra calls you have to make because everything is so spread out…

Doesn’t that make the OOP written program run slower? (not that you would notice on todays hardware, but still)

Why would anyone use OOP if it wasn’t better in some ways?

Ease of programming can be one reason why people would be willing to sacrafice some performance.

Hence why not many people write large programs in pure assembely, it’s very hard and even though certain areas of C++ would be just as fast, you could really make application perform so much better. It also has issue with hardware support as it will only work on CPU that have the exact same registers, flags and so on.

Also, languages are languages - its the part that makes it (ideally) easy to write and understand, how this language is then interpreted to CPU instruction can vary. C++ is both procedual and OO, PHP is both procedual and OO - we can all agree that comparing C++ to PHP performance wise is stupid since one is complied to direct CPU instructions and the other has to read a script in human language (which means many wasted CPU cycles) and has to do many other CPU wasting task everytime on exicution.

There’s also the other fact that not all OOP languages are actually pure OOP and thus is rather missleading /false advertising.

In general, OOP is better. it makes programming so much easier, it makes everything very modular (infact, modularity is somthing related to procedual programming if i remember - and OOP is a very advance form of modularity). OOP has a very well defined relationship meaning things probabily get exicuted faster compared to procedual things on more advance programming.