Login Action Required

The NinevehGL Forum uses a new concept of "socialized forum" or as we like to say "Tweet Forum".


Here is the deal:
  1. No new registration is required. Just sign in with your Twitter account and authorize the NinevehGL Forum.
  2. Once you’re in, you'll be able to "Follow a Thread", that means every time that thread receive a new post or update you'll receive a mention on your twitter.
  3. Besides, you can enable "Auto Share", then every new post and/or thread you make will be tweeted on your timeline. (By default, auto-share is enabled only for your threads)

Forum Rules:

1. We understand human comunication can become "hot" sometimes. So some insults and bad words ARE allowed. Just don't push too much being an asshole all the time.

2. SPAMMERS are not allowed. There are penalties for this kind of user and they can be banned forever.

3. You can report other users, if you judge necessary. An user reported many times by many people can also be banned forever. However you can also receive penalties for report deliberately for no apparent reason.

If there is a similar thread title, make sure the other one doesn't already have the answer you're looking for.

This forum uses the BBCode (Bulletin Board Code), here are some instructions:

Bold: [b]text[/b]
Italic: [i]text[/i]
Underline: [u]text[/u]

Code: [code]text[/code]
Quote:
[quote=@username]text[/quote]
[quote]text[/quote]

List:
[ul] [*]item [/ul]
[ol] [*]item [/ol]

URL:
[url]http://url.com[/url]
[url=http://url.com]text[/url]

Image:
[img]http://imageurl.com[/img]

Embed (videos, code, 3D):
[embed]http://url.com[/embed]

Welcome to the NinevehGL's world!
NinevehGL is a 3D engine forged with pure Obj-C.
Welcome to the
Forum!
Hello, Guest.

Your current vote:

You can change your vote many times. But it's still one single vote.

The Global API
Vote this thread:


@dineybomfim

Posts: 571

NGLAdmin

Tue, May 15 2012


This thread is to help you guys with the NinevehGL Global API.

First off, sorry because this API is not in the Docs, however you can find it well documented inside the header file "NGLGlobal.h".

Here you'll understand what is the concept of this API, so you can easily figure out if something you're looking for is inside the Global API or not.

Global API's Responsibilities

You know that NinevehGL is focused on the maximum performance. There is always a relation between Performance VS Quality. This engine is ready to deal with both choices, however by default everything is focused on Performance. All these choices are in the Global API.

So,

  • Color format (by default alpha channel is disabled for the entire application);
  • Textures are set to compressed format (16 bits of color, not 32 bit as the usual);
  • Texture optimization (by default the texture pixels are jagged, not smooth);
  • The render quality is default (by default the Multisampling filter is disabled);
  • The frame rate is in the Global API too.


Another responsibility of the Global API is optimizing the code, dealing globally with local properties. For example, there are import settings that you can set individually for each new import. However with the Global API you can set once the import settings. In this case, if you set a global property it will always override the local properties. To "unset" a global property, set it's value to NGL_NULL

So,

  • Rotation properties (rotation order and the rotation space);
  • The default color for the things using color, like the fog effects;
  • Import settings.


The last thing that is also a responsibility of the Global API is to deal with NinevehGL and OpenGL states. For example, the default OpenGL engine is the ES 2.0. In the future, with new releases of OpenGL you don't need to change anything in your code to take advantage of the new engine, just change a global property in the Global API.

So,

  • The default path in the file system to search for resources (by default it's the main bundle);
  • The OpenGL engine (by default it's OpenGL ES 2.0);
  • Front and Cull face.;
  • Light effects;
  • Multithreading option.


One of the coolest features in NinevehGL is the full Multithreading. However, if you want, you can disable it, but this is not something good, because without the Multithreading you'll block your main thread.

This is something very annoying, you probably know iOS games that have a static image to their loading screens, that's sucks! You can create great loading screens, with animations and progress bars using the NinevehGL multithreading.

Usage
Using the Global API is very easy. This API is made with pure C function and Type Definitions, so its call is:
nglGlobal<PropertyName>(<PropertyValue>);


After calling a sequence of functions you must call the global flush, this is because the Global API always runs asynchronously, independent of the Multithreading option:
nglGlobalFlush();


Here is an example of the Global API usage:

nglGlobalColorFormat(NGLColorFormatRGBA);
nglGlobalTextureOptimize(NGLTextureOptimizeNone);
nglGlobalFPS(30);
nglGlobalLightEffects(NGLLightEffectsOFF);

nglGlobalFlush();


The above code will enable the alpha channel, turn off the texture optimization (that means it will use the original 32 bits of color), decrease the frame rate to 30 and turn off the global light.

That's it. Hope this topic help you guys to understand more about the Global API and how it fits in the NinevehGL context.

Cya
100% like this - 3/3
Technology

NinevehGL is a 3D engine built right on top of OpenGL ES and it uses all the programmable pipeline power, making it easy for you to create great application with shaders.

Share on


Follow NinevehGL
Fastest way to contact us:

Copyright © 2011 db-in. All rights reserved.