Commit Graph

506 Commits

Author SHA1 Message Date
Vincent Pelletier
cc42d5cb24 TINYGL: Fix scissor testing in ztriangle.
When dirty rectangles are enabled, fixes drawing outside (below) set scissor
rectangle.
y and pp1 must stay consistent for scissor testing to be relevant. y is
already incremented along with pp1, and pp1 does not get re-assigned on
part == 2, so do not set y either.
2017-04-23 10:35:04 +00:00
Vincent Pelletier
500803fc38 TINYGL: Implement tglDrawArrays. 2017-04-22 16:42:14 +00:00
Vincent Pelletier
0b823ac2e9 TINYGL: Expose array functions outside of TinyGL namespace.
And prefix them with "tgl" instead of "gl", as in header.
2017-04-22 16:42:14 +00:00
Vincent Pelletier
13ad766b31 Merge pull request #1294 from vpelletier/tinygl_memory
Tinygl memory
2016-08-27 04:58:56 +02:00
Vincent Pelletier
112ca82363 TINYGL: Manage BlitImages with a refcount.
So that zdirtyrect can keep an image alive for longer than its creator
intended.
2016-07-28 23:32:43 +00:00
Vincent Pelletier
8cd029aac7 TINYGL: Add support for 4-bytes words in FrameBuffer::clear{,Region} 2016-07-28 23:29:17 +00:00
Vincent Pelletier
7e51d78480 TINYGL: Fix FrameBuffer::clearRegion color clearing line length. 2016-07-28 15:26:14 +00:00
Vincent Pelletier
e7e1df886e TINYGL: Merge dead kInterpST code path into kInterpSTZ one.
Texture coordinates interpolation along Z coordinate is an extra behaviour
over texture coordinates interpolation along X and Y coordinates.
2016-07-28 02:46:41 +00:00
Vincent Pelletier
a577b4c6a6 TINYGL: Free disposed textures before images.
Reusing function already defined in zdirtyrect.cpp doing both.
2016-07-28 01:55:48 +00:00
Vincent Pelletier
47a1e826e7 TINYGL: Free draw call lists in glClose. 2016-07-28 01:55:48 +00:00
Vincent Pelletier
3221146de9 TINYGL: Always initialise normal and eye coordinates (valgrind) 2016-07-28 01:55:48 +00:00
Vincent Pelletier
786311652a TINYGL: Initialise all light properties (valgrind).
Also, sort initialisation in the same order as declaration, for easier
difference-spotting.
2016-07-28 01:55:48 +00:00
Vincent Pelletier
f272c85704 TINYGL: Initialise z buffer (valgrind) 2016-07-28 01:55:48 +00:00
Vincent Pelletier
369332e464 TINYGL: Treat alpha the same way as other color components.
When kLightsMode (aka kInterpRGB) is false, "a" is always 0 (vertice data is
not used in caller in corresponding branches), so taking it into account makes
all triangles transparent.
This is not visible in practice, because putPixelTextureMappingPerspective is
only called when (kInterpST || kInterpSTZ) is true, and kInterpRGB is always
true when that's the case. But unifying color processing allows further code
simplification.
2016-07-28 01:55:14 +00:00
Vincent Pelletier
0065f38251 TINYGL: Reuse global const. 2016-07-28 01:55:14 +00:00
Vincent Pelletier
e1d5b811e1 Revert "GRIM: fixed transparency in TinyGL renderer"
This reverts commit b8bddf64da.

Since 9b7548ccf7, alpha test is enabled
when drawing model faces, fixing transparency issues in GRIM which were
corrected by reverted commit.
It is incorrect to test transparency when caller did not enable it.
Also, this change bypasses increments done at the end of
putPixelTextureMappingPerspective, so transparent textures in 16 bits mode
would be stuck on the transparent pixel for the current line's 8-pixel run
in filTriangle, and would ignore z coordinate.
2016-07-28 01:55:14 +00:00
Vincent Pelletier
8b6d362c58 TINYGL: Reuse _enableScissor property.
Should have been part of:
  commit db764b1ca5
  TINYGL: Entirely avoid calling scissorPixel in putPixel when possible.
2016-07-28 01:55:14 +00:00
Vincent Pelletier
18342118dc TINYGL: Fix y coordinate tracking when drawing triangles.
Increment y inside the loop, not outside.
Set y to the topmost vertex y coordinate, which depends on which half of
the triangle is being drawn.
Should have been part of:
  commit 3c2689a65f
  TINYGL: Optimise scissorPixel.

This does not (should not) fix any visible regression, as pixel scissor is
only (?) used when dirty rectangle mecanism is enabled (and it is disabled).
2016-07-28 01:55:10 +00:00
Vincent Pelletier
0a41574079 TINYGL: Process colors in RGBA 32bits internaly. 2016-07-24 01:20:50 +02:00
Paweł Kołodziejski
ac9986452e Merge pull request #1279 from vpelletier/tinygl_reunroll
TINYGL: reduce code duplication in ztriangles (was: [RFC] TINYGL: unroll some loops)
2016-07-23 13:59:14 +02:00
Vincent Pelletier
80983c1b69 TINYGL: Unroll FrameBuffer::blitOffscreenBuffer.
This method is used to blit large buffers, so a large unrolling is still
beneficial. As it is the second hottest-spot in grim, the frame rate
increase is most significant there (compared to emi).
2016-07-22 14:58:58 +02:00
Vincent Pelletier
cf53e8871d TINYGL: Unroll DRAW_SHADOW and DRAW_SHADOW_MASK.
Also, update z in the second DRAW_SHADOW loop like it is done in the first.
Also, check each shadow mask pixel in DRAW_SHADOW, instead of 1 every 4.
2016-07-22 14:49:16 +02:00
Vincent Pelletier
93c6dc6027 TINYGL: Avoid calling memset_{s,l} when possible.
It is possible to convert calls to memset_{s,l} into call to memset when
all bytes of the depth or color value are the same (which is the likely
case), improving buffer clearing speed.
2016-07-22 07:19:48 +02:00
Paweł Kołodziejski
74ffd37dbe Merge pull request #1278 from vpelletier/tinygl_scissorpixel
Tinygl: optimise scissorpixel
2016-07-21 21:57:05 +02:00
Paweł Kołodziejski
4ffde5f680 Merge pull request #1282 from vpelletier/tinygl_loaddata_pixelformat
TINYGL: Expect colorKey in the same pixel format as surface.
2016-07-21 18:30:02 +02:00
Vincent Pelletier
46329cca87 TINYGL: Do not compute dirty region when its result is not used. 2016-07-21 16:42:24 +02:00
Vincent Pelletier
d2defcd1cc TINYGL: Actually check if alpha test and blending are enabled. 2016-07-21 16:42:10 +02:00
Vincent Pelletier
a1418732ec TINYGL: Typo in disabled code. 2016-07-21 16:41:24 +02:00
Vincent Pelletier
8ec310468d TINYGL: Replace multiplications by iterative additions.
As an iteration is done already anyway.
2016-07-21 16:41:18 +02:00
Vincent Pelletier
a831238a96 TINYGL: Drop some unused locals. 2016-07-21 16:40:36 +02:00
Vincent Pelletier
4ff03d060e TINYGL: Call tglColor4f from tglColor4fv. 2016-07-21 16:40:07 +02:00
Vincent Pelletier
d437892538 TINYGL: Get rid of PSZB as it duplicates pixelbytes. 2016-07-21 16:39:40 +02:00
Vincent Pelletier
7c1a15c6e8 TINYGL: Expect colorKey in the same pixel format as surface.
So caller does not have to depend on the pixel format used internally to
BlitImage.
Update callers which do request for color keying (GRIM/EMI only).
Also, remove a special-casing of transparent color when converting image
format which sets a color in a packed format independent from actual
destination format.
Also, in GfxTinyGL::createTextObject, prefer changing invisible colorKey
value than actually-visible color.
2016-07-21 16:17:32 +02:00
Vincent Pelletier
db764b1ca5 TINYGL: Entirely avoid calling scissorPixel in putPixel when possible. 2016-07-21 16:02:22 +02:00
Vincent Pelletier
3c2689a65f TINYGL: Optimise scissorPixel.
Scissor operations happen in a 2d rectangle, but it used to take a buffer
offset as a parameter. As a result, it had to divide that value with its
width, which is an expensive operation, which has to be done for each
pixel candidate for display (even before z-buffer comparison when
applicable, in current implementatoin).
But callers actually generate the buffer offset from rectangular
coordinates, so propagate these instead.
This sadly increases API redundancy, but saves a lot of time in a very
frequent occurrence (especially when enabling dirty rect mechanism,
which is not yet enabled by default).
2016-07-21 15:56:29 +02:00
Paweł Kołodziejski
d1be78ca49 Merge pull request #1269 from vpelletier/tinygl_optimise_light
Tinygl: optimise gl_shade_vertex
2016-07-20 14:39:05 +02:00
Paweł Kołodziejski
9acb1b9039 Merge pull request #1275 from vpelletier/valgrind
TINYGL, GRIM: Fix various errors (mostly memory leaks) found by valgrind
2016-07-20 14:09:52 +02:00
Vincent Pelletier
638b841c74 TINYGL: Simplify zline.cpp .
drawLine was broken for dx = 0 lines.
Also, the split between fillLineGeneric and drawLine, along with the many
parameters exchanged (with obscure names with subtle differences), made
the code hard to understand.
This implementation should be easier to check.
There was no visible CPU usage change.
Fixes GRIM's ticket printer, which are composed of a lot of vertical
segments.
2016-07-18 15:55:08 +02:00
Paweł Kołodziejski
d467980499 Merge pull request #1262 from vpelletier/tinygl_dirty2d
GRIM: Fix drawLine/Rect/Polygon in TinyGL renderer
2016-07-18 05:17:35 +02:00
Vincent Pelletier
db8cee2a69 TINYGL: Free BlitImage memory on close. 2016-07-18 04:36:37 +02:00
Vincent Pelletier
97dc3881e0 TINYGL: Add free_texture variant taking a GLTexture * argument.
To avoid looking texture up in the hash table when caller has a pointer to
it already. Aka, O(0) is better than O(1).
2016-07-18 04:34:09 +02:00
Vincent Pelletier
306fdff963 TINYGL: Dispose of textures beyond the first hash table entry. 2016-07-17 15:06:30 +00:00
Vincent Pelletier
95cc5127e0 TINYGL: Consistently consider Texture::handle as unsigned.
Texture handles are unsigned integers everywhere else.
2016-07-17 15:06:30 +00:00
Vincent Pelletier
ed2fdb3aba TINYGL: Correct dot-product after its sign is known.
Normalising d when light is not in front of surface (nor behind when in
two-sides mode) is not needed as the value will not be used.
The same optimisation is already done when handling specular lights.
Also, remove "if (... > 1E-3)" conditions: as dot-product is not zero,
neither operand is zero, so this test (as a divide-by-zero protection) can
be removed.
2016-07-16 14:38:41 +00:00
Vincent Pelletier
f66026a8aa TINYGL: Only do spotlight & specular computations when actually needed.
Spotlight and specular requires normalized d.
Skip specular if the light source or the material have no specular
component.
2016-07-16 12:17:59 +00:00
Vincent Pelletier
411e16fba5 TINYGL: Fix default diffuse and specular values for lights > 0. 2016-07-16 12:17:59 +00:00
Vincent Pelletier
342cf9a60d TINYGL: Simplify a bit updateTmp . 2016-07-15 22:20:41 +00:00
Vincent Pelletier
03da50312b TINYGL: Move the task of writing to z-buffer to FrameBuffer::writePixel.
Because writePixel may decide to not write anything (alpha test), in which
case no z-buffer write should happen.
Factorises code.
Fixes apparent back-face culling in GRIM behind transparent textures, like
the tube (the 3d-shape Manny takes out, not the flat image in foreground)
in set mo.
2016-07-14 21:30:18 +00:00
Vincent Pelletier
a336422811 TINYGL: Fix clipped triangle vertices alpha channel.
In all 4 updateTmp call places, q is not initialised, so there is nothing
of value in the alpha channel (it's 0). So just apply the same rule as for
other color channels.
2016-07-14 15:36:28 +00:00
Vincent Pelletier
46fa5eb373 TINYGL: Fix off-by-one in TGL_LINE_LOOP/TGL_LINE_STRIP .
Also, draw last line from last point to first instead of first point to
last as the latter leaves an unpainted pixel for some reason.
2016-07-11 14:52:36 +00:00
Vincent Pelletier
98696865df TINYGL: Fix TGL_QUADS with more than one quad.
Fixes checkbox border on Copal's computer.
2016-07-11 00:30:58 +00:00
Vincent Pelletier
e72db42ef0 TINYGL: Fix tglOrtho matrix definition.
As per glOrtho documentation, bottom-right must be 1.
Also, in TinyGL, matrices are row-major, so m._m[0][3] is r[3], not
r[12].
2016-07-11 00:00:30 +00:00
Vincent Pelletier
6f1e46d6b4 TINYGL: Implement tglColor3ub. 2016-07-11 00:00:30 +00:00
Vincent Pelletier
93d23656fa TINYGL: Do not clear matrix_model_projection_updated in gl_matrix_update.
Changing texture or color matrices must not prevent a model projection
update, even if it is done last.
2016-07-10 13:19:45 +00:00
Vincent Pelletier
f75767fc78 TINYGL: Always check if texture matrix need applying.
matrix_model_projection_updated is not set when texture matrix alone is
modified.
2016-07-10 13:13:46 +00:00
Vincent Pelletier
f6bbbc7b28 TinyGL: Use standard initial diffuse and specular values.
As per OpenGL specifications, light 0 is the only light with full diffuse and
specular light initial state. This should not affect residualvm as all enabled
light properties are configured.
2016-01-01 17:37:23 +01:00
Vincent Pelletier
09478b1791 TinyGL: Use normalised position for directional lights.
So that dot-product result (used for attenuation) is between -1 and 1.
This should make no difference for GRIM: as far as I can see, all
direction vectors are already normalized in data files.
2016-01-01 17:29:19 +01:00
Vincent Pelletier
ce5af40a0b TinyGL: Store spot direction in eye coordinates.
As per OpenGL specifications:
  The spot direction is transformed by the upper 3x3 of the modelview
  matrix when glLight is called, and it is stored in eye coordinates.
2015-05-06 19:49:35 +02:00
Pawel Kolodziejski
f039ccd474 TINYGL: make consistent between allocation and free resource 2014-12-27 23:28:11 +01:00
Pawel Kolodziejski
b8bddf64da GRIM: fixed transparency in TinyGL renderer 2014-12-25 15:16:50 +01:00
Pawel Kolodziejski
c2a9a394c3 MYST3, TINYGL: fixed endian issue 2014-12-23 20:40:59 +01:00
Dries Harnie
06d077d00d TINYGL: Rename glColor3fv to tglColor3fv
Linking TinyGL and OpenGL into the same binary could cause conflicts
because both have a glColor3fv function.
It is currently not used in ResidualVM, so it is safe to change this.
2014-09-28 12:14:44 +02:00
Pawel Kolodziejski
6fc28fe37d TINYGL: gl -> tgl rename 2014-09-21 15:05:17 +02:00
Pawel Kolodziejski
e20ef7a4f8 TINYGL: added support for alpha channel for non texture triangles. 2014-09-12 06:50:17 +02:00
Paweł Kołodziejski
df14a526f2 Merge pull request #1033 from subr3v/master-changlog
TINYGL: Updated changelog.
2014-08-16 18:26:03 +02:00
Stefano Musumeci
f615ba388b TINYGL: Updated changelog. 2014-08-16 18:25:23 +02:00
Paweł Kołodziejski
30c5e793f2 Merge pull request #1010 from subr3v/myst3-subtitles-fix
TINYGL: Fixed support to RGB textures.
2014-08-16 17:35:11 +02:00
Stefano Musumeci
3beb5ff233 TINYGL: Reordered expression to make it more readable. 2014-08-16 17:31:54 +02:00
Stefano Musumeci
23385b3a4a TINYGL: Fixed compiler warnings. 2014-08-16 16:04:20 +02:00
Stefano Musumeci
5bd0a864f5 TINYGL: Fixed line breaks. 2014-08-16 16:04:16 +02:00
Stefano Musumeci
974f47fa42 TINYGL: Added a way to disable or enable dirty rectangles at runtime. 2014-08-16 16:04:10 +02:00
Stefano Musumeci
e1aea3a1f3 TINYGL: Added safety checks to Linear Allocator. 2014-08-16 16:04:05 +02:00
Stefano Musumeci
41737fcc21 TINYGL: Added/Updated license header in tinyGL files. 2014-08-16 16:03:54 +02:00
Stefano Musumeci
2cf70d6d76 Merge branch 'master' into tinygl-dirty-rects-fixed
Conflicts:
	graphics/tinygl/ztriangle.cpp
2014-08-16 16:03:27 +02:00
Joni Vähämäki
5bdfbb29eb TINYGL: Do not write to the depth buffer if depth test is disabled. 2014-08-14 22:01:18 +03:00
Stefano Musumeci
f9332da316 TINYGL: Refactored if-else sequence with progressive function calls. 2014-08-13 22:38:24 +02:00
Stefano Musumeci
0be18788db TINYGL: Minor formatting fixes. 2014-08-13 21:21:09 +02:00
Stefano Musumeci
9e807696bc TINYGL: Minor style/formatting fixes. 2014-08-13 21:20:15 +02:00
Stefano Musumeci
2c8f2ecd0b TINYGL: Moved some variables from public to private access. 2014-08-13 21:13:50 +02:00
Stefano Musumeci
e58c1361fe TINYGL: Added const modifier to const variables. 2014-08-13 21:11:35 +02:00
Stefano Musumeci
6c83f83b6c TINYGL: Fixed line breaks. 2014-08-13 21:11:24 +02:00
Stefano Musumeci
a5e91722de TINYGL: moved global variable to GLContext 2014-08-13 21:03:42 +02:00
Stefano Musumeci
7cb1fd7c8b TINYGL: Added default values to Line empty constructor. 2014-08-13 20:51:53 +02:00
Pawel Kolodziejski
1b48414d7e TINYGL: cleanup license headers 2014-08-13 18:52:52 +02:00
Stefano Musumeci
85fdaed682 TINYGL: Added safe check on blit image delete. 2014-08-13 15:38:00 +02:00
Stefano Musumeci
d0579291bd TINYGL: Fixed support to RGB textures. 2014-08-13 15:20:17 +02:00
Stefano Musumeci
92d8ecc34c TINYGL: Added depth test enabled state tracking to dirty rects. 2014-08-13 14:33:54 +02:00
Stefano Musumeci
e3acac6187 TINYGL: Merged conflicts 2014-08-13 14:27:10 +02:00
Stefano Musumeci
8abb5b008c Merge branch 'master' into tinygl-dirty-rects
Conflicts:
	graphics/tinygl/zbuffer.cpp
	graphics/tinygl/zbuffer.h
2014-08-13 14:06:34 +02:00
Joni Vähämäki
c420196014 TINYGL: Always pass the depth test if TGL_DEPTH_TEST is disabled. 2014-08-12 17:46:48 +03:00
Stefano Musumeci
8c13ef4c35 TINYGL: Added some comments to draw call classes. 2014-08-11 22:03:07 +02:00
Stefano Musumeci
5cd3cfe548 TINYGL: Fixed a bug with triangle strip rendering. 2014-08-11 17:24:21 +02:00
Stefano Musumeci
1990876f7a TINYGL: Added some more documentation. 2014-08-11 16:38:52 +02:00
Stefano Musumeci
c64e2884b2 TINYGL: Added some more documentation to blitting code. 2014-08-10 22:02:06 +02:00
Stefano Musumeci
4b9c5a7633 TINYGL: Wrong commit fixup. 2014-08-10 21:15:41 +02:00
Stefano Musumeci
6e75f6b594 TINYGL: Renamed rasterization functions template parameters with constants naming convention. 2014-08-10 20:31:07 +02:00
Stefano Musumeci
389bcba20d TINYGL: Renamed blit function template parameters with constants naming convention. 2014-08-10 20:29:09 +02:00
Stefano Musumeci
f43d39172b TINYGL: Refactored big complex if else sequence with template function calls. 2014-08-10 20:18:04 +02:00
Stefano Musumeci
d747cad5b2 TINYGL: Improved code commenting. 2014-08-10 20:17:31 +02:00
Stefano Musumeci
ff488253e7 TINYGL: Moved variable initialization in the appropriate line. 2014-08-10 19:39:56 +02:00
Stefano Musumeci
986d6a9d8b TINYGL: Minor line break fixup. 2014-08-10 19:39:38 +02:00
Stefano Musumeci
ca54fd848a TINYGL: Renamed member functions loadState to captureState. 2014-08-10 19:39:21 +02:00
Stefano Musumeci
28214fe84e TINYGL: Added preprocessor variable to enable/disable dirty rects debug. 2014-08-10 19:38:46 +02:00
Stefano Musumeci
5adba756e3 TINYGL: Renamed tglBlitScissorRect into tglBlitSetScissorRect 2014-08-10 19:38:06 +02:00
Stefano Musumeci
daa8394adb TINYGL: Moved DrawCallType enum inside DrawCall. 2014-08-10 19:37:26 +02:00
Stefano Musumeci
c34dc7e4a5 TINYGL: Moved variable declaration to its first use. 2014-08-10 19:36:32 +02:00
Stefano Musumeci
bbe0811aea TINYGL: Renamed iterator varaibles from l and r to y and x 2014-08-10 19:35:29 +02:00
Stefano Musumeci
0e4c062f3a TINYGL: Reodered member variables and initialization in BlitImage. 2014-08-10 19:34:47 +02:00
Stefano Musumeci
a59c1de0ff TINYGL: Fixed misspelt function name. 2014-08-10 19:05:32 +02:00
Stefano Musumeci
a42d9e2b2d TINYGL: Added comment to the code. 2014-08-09 14:40:18 +02:00
Stefano Musumeci
688a76455a TINYGL: Fixed typo in code. 2014-08-09 14:40:08 +02:00
Stefano Musumeci
2b368d960f TINYGL: Fixed a mistake in while -> loop refactoring. 2014-08-09 14:39:05 +02:00
Stefano Musumeci
520a866627 TINYGL: Documented linear allocator. 2014-08-09 14:36:46 +02:00
Stefano Musumeci
307a80ae9e TINYGL: Added doxygen comments to blit API. 2014-08-09 14:33:23 +02:00
Stefano Musumeci
a274a50a22 TINYGL: Removed magic numbers in computeDirtyRegion 2014-08-09 14:14:25 +02:00
Stefano Musumeci
563a26e998 TINYGL: Refactored tglPresentBuffer to increase code readability. 2014-08-09 13:43:47 +02:00
Stefano Musumeci
91dc7904f3 TINYGL: Refactored while loops into for loops. 2014-08-09 13:07:46 +02:00
Stefano Musumeci
13698796ec TINYGL: Rewrote if conditions for more clarity. 2014-08-09 12:34:40 +02:00
Stefano Musumeci
c27be840ea TINYGL: Added not equality operator for GLVertex and DrawCall. 2014-08-09 12:34:26 +02:00
Stefano Musumeci
35a36f7c09 TINYGL: Renamed blit images container with proper class naming convention. 2014-08-09 12:17:40 +02:00
Stefano Musumeci
bd0c813296 TINYGL: Changed blit images container from Array to List 2014-08-09 12:17:11 +02:00
Stefano Musumeci
7b3f0850b8 TINYGL: Moved some functions inside TinyGL namespace 2014-08-09 12:10:26 +02:00
Stefano Musumeci
b83dc09f84 TINYGL: Added const to member function. 2014-08-09 12:02:42 +02:00
Stefano Musumeci
f107e7cf6b TINYGL: Renamed variables to camelCase. 2014-08-09 12:00:43 +02:00
Stefano Musumeci
a4b57371e2 TINYGL: Refactored out duplicated code. 2014-08-08 13:09:44 +02:00
Stefano Musumeci
4518021484 TINYGL: Commented out a debug feature. 2014-08-08 13:09:18 +02:00
Stefano Musumeci
d1b9585662 TINYGL: Fixed formatting. 2014-08-08 12:43:39 +02:00
Stefano Musumeci
da01fb30b6 TINYGL: removed commented out 2014-08-07 21:49:36 +02:00
Stefano Musumeci
83626dce94 TINYGL: Fixed code formatting. 2014-08-07 21:49:13 +02:00
Stefano Musumeci
10a3b9b0ce TINYGL: Replaced size_t with int 2014-08-07 21:48:38 +02:00
Stefano Musumeci
72054e87ca TINYGL: Replaced magic numbers with a constant. 2014-08-07 21:47:54 +02:00
Stefano Musumeci
6cd062826b TINYGL: Renamed zrect in zdirty rect 2014-08-07 17:56:01 +02:00
Stefano Musumeci
75ea6893ef TINYGL: renamed glIssueDrawCall to tglIssueDrawCall. 2014-08-07 17:38:11 +02:00
Stefano Musumeci
5ae16bd1fe TINYGL: Added const modifier to equality operator. 2014-08-07 17:31:45 +02:00
Stefano Musumeci
f4d474ca64 TINYGL: Removed compiler warnings about shadowed variables. 2014-08-07 17:31:26 +02:00
Stefano Musumeci
fe3cd44197 TINYGL: Removed unnecessary copy. 2014-08-07 17:30:54 +02:00
Stefano Musumeci
7e32942ce8 TINYGL: Fixed naming convention in ClearDrawCall 2014-08-07 17:30:23 +02:00
Stefano Musumeci
8c94a65a70 TINYGL: Optimized rasterization routines by moving more data from dynamic evaluation to static evaluation. 2014-08-06 21:52:41 +02:00
Stefano Musumeci
e93e4c0f18 TINYGL: Changed allocation scheme for Draw Call instances. 2014-08-06 21:52:02 +02:00
Stefano Musumeci
a0a17717be TINYGL: Added linear allocator for frames draw call data. 2014-08-06 21:50:49 +02:00
Stefano Musumeci
98a77b2801 TINYGL: Fixed rasterization area detection. 2014-08-06 21:10:04 +02:00
Stefano Musumeci
3c17942f2c TINYGL: Removed debug line 2014-08-06 21:07:45 +02:00
Stefano Musumeci
e54765ff71 TINYGL: Fixed a bug with calculation of bounding rectangle of rasterization draw call. 2014-08-06 01:42:06 +02:00
Stefano Musumeci
911c82d238 TINYGL: Refined dirty rects logic. 2014-08-05 20:33:42 +02:00
Stefano Musumeci
aa847ab56b TINYGL: Improved dirty area detection for rasterization draw calls. 2014-08-05 20:02:23 +02:00
Stefano Musumeci
7eab9b375c TINYGL: Fixup formatting. 2014-08-05 20:00:36 +02:00
Stefano Musumeci
6afe1c6f14 TINYGL: Fixup formatting. 2014-08-05 20:00:24 +02:00
Stefano Musumeci
2af17ffdb3 TINYGL: Added default scissor rectangle value. 2014-08-05 20:00:13 +02:00
Stefano Musumeci
0d78b652bd TINYGL: Implemented pixel scissoring in line rasterization. 2014-08-05 13:22:46 +02:00
Stefano Musumeci
4d2dc3f0aa TINYGL: Added pixel scissoring logic to triangle rasterization. 2014-08-05 13:21:25 +02:00
Stefano Musumeci
e4526b3ed5 TINYGL: Separated pixel scissoring logic from pixel writing one. 2014-08-05 13:21:03 +02:00
Stefano Musumeci
78aa22180b TINYGL: Fixed a bug with image clipping. 2014-08-05 13:20:18 +02:00
Stefano Musumeci
7bacf3c6b5 TINYGL: Fixed a bug with flipped and clipped blitting 2014-08-05 13:19:57 +02:00
Stefano Musumeci
f8070776a5 TINYGL: Fixed a bug that caused unneessary draw call creation. 2014-08-05 13:18:47 +02:00
Stefano Musumeci
d2450c6de0 TINYGL: Fixed a bug caused by wrong branch exclusion 2014-08-03 22:17:02 +02:00
Stefano Musumeci
12f54643f7 TINYGL: Moved a check in a function called less frequently 2014-08-03 22:16:18 +02:00
Stefano Musumeci
0c145a7ffb TINYGL: Formatting fixup. 2014-08-03 21:05:07 +02:00
Stefano Musumeci
e7513920be TINYGL: Fixup formatting. 2014-08-03 21:04:35 +02:00
Stefano Musumeci
5ff8765650 TINYGL: Formatting fixup 2014-08-03 21:02:16 +02:00
Stefano Musumeci
dc153a727b TINYGL: Fixed a bug with blit image version not being updated properly. 2014-08-03 20:56:38 +02:00
Stefano Musumeci
70d326f534 TINYGL: Refined rectangles merging and duplicated removal logic. 2014-08-02 21:50:56 +02:00
Stefano Musumeci
ce4d4801df TINYGL: Refined dirty regions redraw logic. 2014-08-02 21:50:31 +02:00
Stefano Musumeci
f4d6c53592 TINYGL: Refined dirty region detection by adding a check on textures and blit textures version 2014-08-02 21:49:14 +02:00
Stefano Musumeci
e60d5060d1 TINYGL: Fixed a bug with z buffer blitting. 2014-08-02 21:46:07 +02:00
Stefano Musumeci
f6c259684c TINYGL: Added blit image versioning. 2014-08-02 21:44:23 +02:00
Stefano Musumeci
1220e5373f TINYGL: Moved a check down, optimizing away a case where the pixel is ignored. 2014-08-02 21:43:27 +02:00
Stefano Musumeci
94a41de865 TINYGL: Added texture data versioning.
This is introduced to detect changes when a texture is updated.
2014-08-02 21:42:25 +02:00
Stefano Musumeci
89582a3cff TINYGL: Fixed typo in code. 2014-08-01 19:46:23 +02:00
Stefano Musumeci
eadcd65d5e TINYGL: Refined dirty rects execution implementation. 2014-08-01 19:46:22 +02:00
Stefano Musumeci
e33a2ed3af TINYGL: Implemented partial draw call execution. 2014-08-01 19:46:21 +02:00
Stefano Musumeci
3965d93c1b TINYGL: Implemented clipped bitmap blitting. 2014-08-01 19:45:59 +02:00
Stefano Musumeci
2189e97409 TINYGL: Implemented partial screen clearing. 2014-08-01 19:45:55 +02:00
Stefano Musumeci
79ea06e41d TINYGL: Implemented scissor rectangle in frame buffer. 2014-08-01 19:45:32 +02:00
Stefano Musumeci
5049413d24 TINYGL: Minor optimization.
Note: removed a duplicated if check.
2014-08-01 19:08:43 +02:00
Stefano Musumeci
447aa02d03 TINYGL: Implemented dirty rects region detection and merging. 2014-07-31 15:32:56 +02:00
Stefano Musumeci
ae59f92ce4 TINYGL: Implemented equality operators for draw calls. 2014-07-31 15:32:56 +02:00
Stefano Musumeci
a54020bd75 TINYGL: Implemented equality operator for draw call states. 2014-07-31 15:25:37 +02:00
Stefano Musumeci
ca1623517a TINYGL: Implemented equality operator for GLVertex. 2014-07-31 15:24:58 +02:00
Stefano Musumeci
4332aaf378 TINYGL: Implemented equality operator for ZBufferPoint 2014-07-31 15:24:41 +02:00
Stefano Musumeci
bdefce84b9 TINYGL: Implemented equality operator for BlitTransform. 2014-07-31 15:24:25 +02:00
Stefano Musumeci
f192fac096 TINYGL: Improved dirty rectangle rendering by differentiating draw call types by color. 2014-07-28 18:33:04 +02:00
Stefano Musumeci
76e6499cb5 TINYGL: Added dirty region computation for rasterization draw calls. 2014-07-28 18:32:28 +02:00
Stefano Musumeci
8b3a080b04 TINYGL: Implemented debug rendering of dirty regions 2014-07-27 19:57:43 +02:00
Stefano Musumeci
2196b66cb7 TINYGL: Added stub implementation for draw call dirty region detection. 2014-07-27 19:53:10 +02:00
Stefano Musumeci
29efd03671 TINYGL: Added an utility function that gives the size of a previously loaded blitImage. 2014-07-27 19:51:16 +02:00
Stefano Musumeci
2e8b9b3f4e TINYGL: Added an outline rectangle drawing function inside zrect. 2014-07-27 19:50:24 +02:00
Stefano Musumeci
365839e007 TINYGL: Added a way to optionally restore the state after a draw call. 2014-07-27 19:45:33 +02:00
Stefano Musumeci
529cc2b1c6 TINYGL: Fixed a bug with how textures were deleted inside tglPresentBuffer. 2014-07-26 17:57:15 +02:00
Stefano Musumeci
7f560daf04 TINYGL: Replaced Array with List as the container for draw calls queue.
NOTE: I also had to construct the struct GLContext properly now.
2014-07-26 17:56:44 +02:00
Stefano Musumeci
98d6944c22 TINYGL: Moved rasterization logic inside draw call.
Note: As a side effect to this draw calls are now batched together.
2014-07-26 17:55:34 +02:00
Stefano Musumeci
83e1d0a699 TINYGL: Added a few more information to the state stored for Rasterization draw call. 2014-07-25 16:02:26 +02:00
Stefano Musumeci
a96597b0e0 TINYGL: Added a getter function to FrameBuffer. 2014-07-25 16:02:25 +02:00
Stefano Musumeci
390e07f02d TINYGL: Added ZBuffer mode to blitting draw call type. 2014-07-25 16:02:25 +02:00
Stefano Musumeci
b5720b425f TINYGL: Added tglBlitZBuffer as a way to render to the Z buffer. 2014-07-25 16:02:24 +02:00
Stefano Musumeci
7fdd5bcd9a TINYGL: Implemented ClearBuffer draw call type. 2014-07-25 16:02:23 +02:00
Stefano Musumeci
b5bb75cc9e TINYGL: Change a detail in the API implementation.
Reason: changing this allows to get a valid value of alphaTestFunc from the function instead of a value that will always be
transformed inside the setter when it could be transformed somewhere else without hurting anyone.
2014-07-25 16:02:22 +02:00
Stefano Musumeci
8d498699b3 TINYGL: Encapsulated draw calls issuing inside a function. 2014-07-25 16:02:21 +02:00
Stefano Musumeci
f2bfdc672d TINYGL: Formatting style fixup. 2014-07-25 16:01:34 +02:00
Stefano Musumeci
96167b84c4 TINYGL: Removed duplicated variables.
Explanation: those two variables were already tracked inside the class FrameBuffer and they were duplicated here, since there is no need to keep a copy of those variables I just removed them.
2014-07-25 15:54:07 +02:00
Stefano Musumeci
2b3fd8501a TINYGL: Changed the way tinyGL textures are disposed. 2014-07-25 12:59:51 +02:00