Skip to content
/ mtexp Public

an old library for setting up fixed function OpenGL multitexturing with simple expressions

License

Notifications You must be signed in to change notification settings

jtsiomb/mtexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Historical note from the future
-------------------------------
libmtexp is an old library I wrote back in the early 00s to make it easier to
setup fixed function OpenGL multitexturing.

Back then pixel shaders where in their infancy, or at least not ubiquitous yet.
To combine multiple textures, we had to deal with the fixed function
multitexturing interface of OpenGL, which involved calling glTexEnv a bunch of
times for each texture unit.

Now there's no point to any of this. Shaders made it trivial to combine multiple
textures in arbitrary ways. I'm uploading this code just as a reminder of the
olden days.

Original readme follows.
-----------------------

libmtexp is a library that provides an intuitive interface to OpenGL
multitexturing.

Simply call mtexp_create with an expression, and any number of texture objects
as arguments, to compile a multitexturing state. Then call mtexp_enable with the
returned state to use it for rendering. See examples/mtex_expr.c for details.

For example the expression "t0 * c + t1" would result in multiplying the first
texture with the color produced by ligthing calculations or glColor calls, and
adding the second texture to that. Immediate colors can be specified in angle
brackets like this: <r g b> where r, g, and b are values from 0 to 1. Standard
operator precedence and associativity rules apply, and you can use parentheses
to change the term grouping as usual.

Try running the example program with various expressions, in quotes as a single
command-line argument, to see how it works in practice.


- Compiling on UNIX

To build libmtexp as a shared library just type `make' (without the quotes
obviously). If you wish to build a static library instead, type `make
libmtexp.a'.
Then you may type `make install' as root, to install the library. To change the
installation prefix, edit the first line of the Makefile, the default is
/usr/local.
You may also wish to change to the examples directory and compile the sample
program there by typing make.


- Compiling on Windows

You can only build libmtexp as a static library under windows. You must have MS
Visual Studio.NET in order to use the included project file, otherwise just make
a new static library win32 project add the source files in the src directory,
and add the src directory to the project's include path.
Open the included mtexp.sln solution which contains two projects, the library
and the example, and compile them from there.
No installation procedure on windows, just add the src/ subdirectory of mtexp to
the include path of your program that uses mtexp, and link with the static
library which should be at the Release or Debug directories under mtexp when you
build it.


- License

libmtexp is free software, released under the GNU General Public License. See
COPYING at the root directory of the library for more details.
Copyright (c) 2005 John Tsiombikas.


- Contact information

email: nuclear@member.fsf.org
web: http://nuclear.mutantstargoat.com

About

an old library for setting up fixed function OpenGL multitexturing with simple expressions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published