BGE: Allow access to original texture openGL Bind code/Id/Number
authorUlysse Martin <you.le@live.fr>
Thu, 18 Feb 2016 10:56:25 +0000 (11:56 +0100)
committerPorteries Tristan <republicthunderbolt9@gmail.com>
Thu, 18 Feb 2016 11:05:53 +0000 (12:05 +0100)
commit608ee3e0734cc307c282a49518c595c674bbb9f0
tree899118179541db8ea68a3673c58624bc021f814c
parente24323ea4012482c4ede3b8ed3a80fe91f416e6e
BGE: Allow access to original texture openGL Bind code/Id/Number

This patch adds a python method to get openGL bind code of material's texture according to the texture slot.

Example:
import bge

cont = bge.logic.getCurrentController()
own = cont.owner

bindId = own.meshes[0].materials[0].getTextureBindcode(0)
Test file: http://www.pasteall.org/blend/40679

This can be used to play with texture in openGL, for example, remove mipmap on the texture or play with all wrapping or filtering options.
And this can be used to learn openGL with Blender.

Reviewers: TwisterGE, kupoman, moguri, panzergame

Reviewed By: TwisterGE, kupoman, moguri, panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1804
doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.h