Commit Graph

43 Commits

Author SHA1 Message Date
Davide Beatrici
b427333257 Auto-update LICENSE.header in source files 2019-01-25 04:56:19 +01:00
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Jan Klass
ce864c77d7 Cast to correct API types
It is better to be explicit and API correct, even if the resulting
types ended up to be the same through typedefs or the implementation
reinterpret-casting to a memory address pointer.
2017-07-11 00:42:08 +02:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Mikkel Krautz
049fcae125 overlay: update to use LICENSE.header. 2016-05-10 22:42:03 +02:00
Kissaki
06d00f4ad4 OpenGL overlay injection requirements
* Only inject if all OpenGL functions used for overlay drawing are found
* Restructure code; use early returns to reduce code block depth
* FNFIND: Don’t redefine macro; use a separate one instead. Use a parameter
for the module handle.
This should make its use and influence less confusing.
2015-01-17 19:39:48 +01:00
Kissaki
2418b80650 Remove unused injection code and function lookups
* Remove GL function resolution of not used functions
* Remove unused SwapBuffer function hooks:

TL;DR: SwapBuffers calls wglSwapBuffers, so we do not need to hook it,
and wglSwapLayerBuffers is for layer planes, which are optional and of
arbitrary number and index - so we never use that to hook/draw.

In detail:

SwapBuffers is actually a function of Gdi32.dll, and the one
you’re supposed to use on windows (MSDN [1]), at least when
statically linking.
The wgl functions are used when dynamically linking.

See OpenGL Windows FAQ [2]

* 5.190 What do I need to know about mixing WGL and GDI calls?
* 5.210 How do I properly use WGL functions?

> So since GDI and the ICD share function names like SwapBuffers, a
> wglSwapBuffers is needed to avoid ambiguity when loading the proc
> dynamically.

Quoted from [3]

wglSwapLayerBuffers is the swap function for layer planes Overlay, Underlay,
and Main Planes. [4]

So using wglSwapBuffers is always enough.
We could draw on other layers, but if hooking into wglSwapLayerBuffers we
would have to know which layer to draw on, and either call it from
wglSwapBuffers or not, depending on the original program rendering that
layer, so that’s not feasible.

In ET:L, for every logged GDI SwapBuffers call, a wglSwapBuffers call follows.

[1] http://msdn.microsoft.com/en-us/library/dd369060%28v=vs.85%29
[2] https://www.opengl.org/archives/resources/faq/technical/mswindows.htm
[3] https://www.opengl.org/discussion_boards/showthread.php/141384-SwapBuffers-or-wglSwapBuffers
[4] http://msdn.microsoft.com/en-us/library/dd368815%28v=vs.85%29
2015-01-17 19:36:44 +01:00
Kissaki
967a325154 In OpenGL Overlay, make code and context swapping more clear
* Declare scope on member variables
* Move GL context initialization logic into separate method
* Make GL context swapping logic more clear (switch and restore)
* Effectively changes: When a new Context object is created, it switches
the OpenGL context, restores the old, and then in the draw call switches
to the context again. Before, it would switch to the new context just
once.
2015-01-17 19:07:33 +01:00
Kissaki
3b507d57b7 Overlay: Use standard OpenGL headers rather than duplicating code
* Verified that defines match with gl.h of Windows SDK 7.1, and added glext.h
2015-01-11 12:04:12 +01:00
Kissaki
250835e83b Overlay: Rework Code.
* Separate DXGI logic from D3D10 into a separate file dxgi.cpp
* Structure code and logic, introduce additional functions
* Introduce constants
* Code commenting
* d3d9.cpp:
** Access devMap via std::find rather than operator[]
** Introduce class Stash to temporarily set variable value and revert on
destruction
** Move logic to function findOriginalDevice
** Use widestring for modulename (consistency)
** Implement Hook for Direct3DCreate9Ex
** Move function IsFnInModule to common lib.cpp/.h
* opengl.cpp:
** Add whitespace to format code
** Fix logging scope prefix
** Remove static global variable
2013-11-22 19:27:52 +01:00
Kissaki
f8f4b0fdec refacs: more elaborative Varnaming; codeformatting 2013-06-11 23:03:30 +02:00
Kissaki
cab4a3d852 Extend Windows Overlay code and clean it up.
Extend to handle library freeing.
Codeformatting and -cleanup, robustness, and make debugoutput more consistent.

* Indroduce hook for freeing loaded DLLs.
This separates logic between loading and freeing, leading to adjustments to
the recently introduced checks for freed DLLs.
* In HardHook::reset() do a clean and complete reset rather than minimal.
* Memvarinitialisation in HardHook
* Remove logically unused variable bPresenting in d3d9.cpp (always false)
* In d3d10.cpp prefix debugoutput with D3D10 consistently; no more DXGI
which is ambiguous with a d3d11 file that also uses DXGI.
* Consistently use ods instead of fods in the overlay files.
Not in HardHook yet, as that class is used in the Mumble client as well atm
* Fix forwarded return value types (LONG to ULONG)
* TODOs for hook-call-logic in multiple places
* Commenting, formatting and scope / order adjustments
* Introduce variables with constant values (replacing magic/undescriptive constants/numbers)
2013-06-11 23:02:14 +02:00
Kissaki
f4c54b24e3 Explicitly mark childmethods as virtual
* Mark the childmethods overwriting the virtual Pipe methods as virtual explicitly
(effectively already were)
2013-06-04 22:38:00 +02:00
Kissaki
bb47083b9f Reduce varscopes and improve debugtext. 2013-06-04 22:37:39 +02:00
Kissaki
e5101f2251 Fix debug output for overlay chain notice
The debug outputs were placed after the return statements, rendering them useless.
Place them in front, so they are executed.
2012-09-23 14:08:37 +02:00
Thorvald Natvig
f3437a6ba7 Update copyright year ranges of dev team. 2011-03-18 05:52:51 +01:00
Stefan Hacker
6380a88687 Transmit fps more often and represent them as float 2010-04-29 15:53:43 +02:00
Stefan Hacker
d8f1ac1115 Add an optional FPS counter to the overlay 2010-04-28 20:22:28 +02:00
Thorvald Natvig
9fa00c3c1c Use premultiplied alpha textures 2010-03-01 03:14:31 +01:00
Thorvald Natvig
6f637c6f03 Indent, changelog, submodule and language update 2010-01-29 13:13:36 +01:00
Thorvald Natvig
d87855071a Use glPixelStorei for subtexture updates on Win32 2010-01-28 12:15:22 +01:00
Thorvald Natvig
e817ee34c8 Indent, changelog, submodule and language update 2010-01-26 17:49:26 +01:00
Thorvald Natvig
7f019a7820 Remove last parts of old SharedMemory 2010-01-26 17:25:41 +01:00
Thorvald Natvig
c16b9b8e8f Indent, changelog, submodule and language update 2010-01-26 15:54:13 +01:00
Thorvald Natvig
e51a048fe9 Make Win32 OGL overlay work in windowed mode 2010-01-26 13:38:38 +01:00
Thorvald Natvig
036c6c3310 Remove dependence on sm.sm from Win32 overlay 2010-01-24 22:19:11 +01:00
Thorvald Natvig
0baf7589ad D3D9, D3D10 and OpenGL/Win32 pipe-based overlay 2010-01-24 17:17:35 +01:00
Thorvald Natvig
16339bfc91 Update license to 2010 2010-01-05 08:49:22 +01:00
Thorvald Natvig
4e675bceb6 Add selfreference for OpenGL 2009-09-24 23:02:26 +02:00
Thorvald Natvig
2ce544f104 Indent and submodule update 2009-03-13 17:21:41 +01:00
Thorvald Natvig
c865f2f342 Update OpenGL overlay to recheck hook 2009-03-12 23:16:40 +01:00
Thorvald Natvig
ac0b3cf4d4 Indenting 2009-03-04 16:32:43 +01:00
Thorvald Natvig
e3f271b553 Indenting update
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1458 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-19 23:09:19 +00:00
Thorvald Natvig
1faac996b2 Support simultaneous overlay in multiple applications.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1443 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-17 02:55:59 +00:00
Thorvald Natvig
c168a48ec2 Always show that we attached to OpenGL in the debug log.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1441 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-17 00:23:11 +00:00
Thorvald Natvig
061aa70e22 Trampoline-based, chaining, push/ret calling overlay.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1440 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-17 00:22:05 +00:00
Thorvald Natvig
ad2b8e2149 Update copyright for 2009
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1380 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-05 15:12:48 +00:00
Thorvald Natvig
974ced33ed Update Win32 Overlay to inject LoadLibraryA. With the CBT hook, this should hopefully be enough.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1369 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-01 18:55:19 +00:00
Thorvald Natvig
1f89fdd23e Move compiler settings to compiler.pri
Fix a lot of warnings with msvc

git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1006 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-03-18 16:26:24 +00:00
Thorvald Natvig
d6ef7b8c51 Compile Win32 with Visual Studio + Intel C Compiler
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@958 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-03-01 16:57:14 +00:00
Thorvald Natvig
dc7e438976 Update copyright for 2008
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@908 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-01-05 16:25:48 +00:00
Thorvald Natvig
3c2dcd6ddb Fix D3D9 textures stacking.
Fix OpenGL grey texture.
Fix CrashLog dumper. (DOH!)


git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@759 05730e5d-ab1b-0410-a4ac-84af385074fa
2007-09-01 00:31:35 +00:00
Thorvald Natvig
fad508fc4d Win32 OpenGL overlay. ETQW :)
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@754 05730e5d-ab1b-0410-a4ac-84af385074fa
2007-08-30 12:39:16 +00:00