engine: Fix issue with GLFW hints

Was causing issues running engine under gDEBugger
mesh: Different flags for mapping/storage

Also added some comments and tweaked map error checking to release the
buffers on error.
Engine & graphics module changes/additions

- Add scene and scene_object structs
- Move extension checking out of mesh code, into init_graphics()
- init_engine() initializes graphics module to check for extensions, etc.
- Scene will contain a tree structure of scene objects representing
  objects in the game world.
	- scene_object currently stores local/world transforms, but will
	  add an index for that object's transforms into a large buffer of
	  matrices so that all of that uniform data can be sent to the
	  shader in a UBO or something like that. It needs to play well
	  with MultiDraw* calls; we can't be updating uniforms for our
	  shader between batches.
		- Probably only need to store world transforms in this
		  buffer, not local transforms.
	- Scene will simply represent a "frozen moment" of the game
	  world. Things like physics will be managed separately at a
	  higher level in the application and be updated before draws.
	- Scene might contain a mesh_buffer as a component for storing
	  data of objects, but that feels like it'd be more appropriate
	  at a higher level, since the scene doesn't need to know what
	  data it's working with, just where it is and how much of it
	  there is.
- Future notes
	- May need to add a reference counter for mesh blocks, so the
	  buffer knows when it has clean up work to do. A "housekeeping"
	  call may be implemented to do this, along with coalescing
	  blocks, etc.
engine/main.c: Don't include graphics/mesh.h

Not needed right now. Includes for library modules will likely be in
the common.h header anyways.
graphics/mesh.h: Comments, new fields to submesh
mesh: mesh_buffer: Remove data size fields

Currently, mesh_buffer is persistently mapped immutable storage, so its
size never changes. But for drawing static geometry, this isn't needed.
Additional functionality and some tweaks to existing functionality is
needed to allow mesh_buffer to be used for such data. It might even be
wise to rename the current mesh_buffer to dynamic_mesh_buffer and create
a new one called static_mesh_buffer, where the dynamic and static refer
to the buffer, not the data they hold.
graphics/mesh.h: Fix BUDDY_ADDR macro

Cast to void * instead of struct data_blk * (renamed type)
graphics: Add grid and more mesh code

- Add static_arrays_buffer, a mesh buffer for objects drawn using
  DrawArrays* routines.
- Grid code added. Grids are drawn using DrawArrays and are stored in
  a static_arrays_buffer. generate_grid() generates the vertex data
  for the grid into a target block of preallocated memory.
graphics/grid: Support XY/YZ grid generation
graphics/grid.c: Format fix
graphics/grid: Fix default generated grid plane
Large graphics module patch

- Additional required extensions
	- ARB_map_buffer_range
		- MapBufferRange was already being used without any issue
		  on my machine, but init_graphics() now checks for
		  support.
	- ARB_multi_draw_indirect
		- We'll use MultiDrawIndirect for dispatching dynamic
		  draw commands.
	- ARB_sync
		- We'll use fences and sync features to make sure we don't
		  stomp on data that is currently being used
- Add draw.h and draw.c files
	- draw_buffer struct, used for generating indirect draw commands
	  to be drawn with MultiDraw* calls.
	- draw_cmd struct, a single draw command, mostly going to be used
	  internally for updating draw_buffer objects.
- Change ERRMESHMAP to ERRBUFFERMAP
	- Added new file map.h containing flags for BufferStorage and
	  BufferMapRange calls.
	- Updated error description returned from error_string()
	  appropriately.
	- Persistently mapped buffers see use outside of the mesh code,
	  so we need a more generic error code.
- Moderate changes to scene struct
	- scene_object data structure no longer a tree, but instead a flat
	  array. Might tweak this a bit more so scene_object represents a
	  virtual object (once again in a tree structure). It consists of
	  an index into the object data array, as well as parent, flag,
	  and transform information, and have the actual data exist
	  exclusively within the scene struct. This way we don't have to
	  do a bunch of pointer chasing when we want to update draw
	  command buffers and send out draw calls as fast as possible.
	  The basic idea is to decouple the scene management and scene
	  draw stages.
Add engine features

- Add render.c and render.c
	- Render code manages current GL state, provides wrappers for
	  changing state.
	- Contains top-level rendering routines
		- pre_render()
		- render()
			- Calls routines for various rendering passes,
			  such as GUI, primitives, etc.
		- post_render()
- Tweak main loop to use above *render() functions
engine: Add executable icon for WIN32 builds
Large patch to engine and graphics, core libs

graphics
========
- Add shader object
	- Creation, read from file/string, compile, link
	- Must manually bind program with UseProgram (will create wrapper
	  for it in engine render code soon)
- scene.h/.c
	- Add generate_scene_draws()
		- For now this really only copies data from the array-of-
		  structs object data into the given draw buffer.
		  Future changes will rework object data into a struct-of-
		  arrays and this function might be removed entirely, if
		  the draw buffer and scene are merged into one object.
	- count/max fields of scene struct no longer prefixed with
	  'scene'.
	- scene_object => scene_node, added new scene_object struct
		- Scene objects are the data used to draw scene nodes.
		  Scene nodes are virtual representations of entities
		  within the game world. Nodes are used in the management
		  (housekeeping) phase of scene operations, i.e. creating,
		  removing, rearranging nodes. This phase modifies data
		  within the objects arrays, which is then used during the
		  draw phase.
		- scene_object data includes per-object data like model
		  transforms and that object's draw command.
	- Add simple create_scene_node() routine.
		- Created node simply has one instance to be drawn. Mesh
		  and draw data need to be modified by hand.
- mesh.h/.c
	- Add destroy_static_arrays_buffer(), primarily for ease of use.
	  Can probably macro-ize this since it just calls DeleteBuffers on
	  the object's single GL buffer.
	- mesh_buffer struct now stores array of MAX_BLOCKS mesh struct
	  elements, to store information about meshes loaded into the
	  buffer. One mesh per block, so max order and min block size
	  need to be tweaked a bit in the buddy memory implementation.
	- Add GENERIC_DATA and BAD_BLOCK block types.
		- GENERIC_DATA used for when a block is allocated but
		  we don't know what kind of data it has yet.
		- BAD_BLOCK used when an error occurs but we don't know
		  how it should be handled.
	- do_coalesce() returns an int, e.g. -ERRHIGHORDER when a block
	  of MAX_ORDER is coalesced.
	- Add do_split(), splits any given block (doesn't need to be a
	  pointer to an array of MAX_BLOCKS elements like some routines
	  require.)
	- Add find_unused_block(), finds a block of a given order in
	  an array of MAX_BLOCKS elements.
		- Doesn't create/destroy blocks, simply searches through
		  the array in a linear fashion for a match.
- draw.h/.c
	- vertex_count field of draw_cmd struct renamed to count. This
	  is an index count, not the number of vertices drawn.
	- size field of draw_buffer now GLsizei
	- zero_draw_cmd() macro moved to draw.h

engine
======
- Render subsystem
	- Add init/deinit routines (declared in render.h, defined in
	  render.c)
		- These functions initialize all graphics resources the
		  engine needs, like shaders, scene and draw buffers, etc.
	- Add primitives render pass
		- Might rename this; it uses a front shader with no
		  texturing.
	- Add create_scene_grid() subroutine (incomplete)
- Include and link to PhysicsFS
- Add resource dir definition for use in PhysicsFS when debugging
  various resources that need to be loaded. Won't add this directory
  to the search path in release builds, as resources will be installed
  along with the executable.
- Add init/deinit_gl() subroutines to clean up code in init.c
- Add global data for use in engine, e.g. primitives buffer & scene

core
====
- New error codes, see error.c for descriptions in error_string()
	- HIGHORDER
	- LOWORDER
	- SCENECAP

Future changes/concerns
=======================
- Might remove block types all together and use MSBs in the order field
  of the mem_blk struct to signify usage state of blocks. The memory
  implementation shouldn't care what kind of data is in it, just that it
  is in use. Mesh buffers, however, should.
- Still have work to do on getting scene/draw buffers working together
engine/render.c: Fix bit flip in Disable wrapper
Separate memory system code from mesh code

Moved data structures, definitions, functions, etc. out of mesh.h/.c
and into new mem.h/.c files.
Large patch on engine components

- Removed engine, made select components part of new engine library
  module
	- Removed common.h/.c, no longer needed
	- Moved GL wrapper functions to glwrap.h/.inl
		- .inl file is to be included in a single source file for
		  an executable build, to define the wrappers declared in
		  the header file.
	- Add application struct
		- Has an API for various tasks that might be shared across
		  different types of applications.
	- Add new config objects
		- Read config files which consist of lines containing
		  a field and value in the format:
		      Field1 "Value1"
		      Field2 "Value2"
		- Need to test writing/saving configs as well as do memory
		  checking.
	- Add window.h/.c with window config code. Since the new config
	  object could serve this purpose, everything except the
	  window_config struct may be removed.
		- Incomplete API functions
- Added client and server executable builds
	- Need to tweak build a bit so that server-only or
	  server-and-client builds can be done as desired. Server-only
	  builds won't need certain libraries like GLEW or GLFW, but
	  the server-and-client builds will need everything.
- New error codes
	- FILEOPENREAD
	- FILEOPENWRITE
	- FILEOPENAPPEND
	- FILEREAD
	- FILEWRITE
	- CONFIGFIELD
	- CONFIGVALUE
	- CONFIGSETTING
- New core header, util.h
	- Contains helpful functions, e.g. bitfield controls
core/util.h: Add some math constants/macros
engine/glwrap.inl: Fix spelling and missing #endif