Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
61fe7b3f
Commit
61fe7b3f
authored
Apr 01, 2010
by
Chris Robinson
Committed by
Alexandre Julliard
Apr 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openal32: Add support for ALC_EXT_thread_local_context.
parent
0540af5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
37 deletions
+77
-37
openal.c
dlls/openal32/openal.c
+77
-37
No files found.
dlls/openal32/openal.c
View file @
61fe7b3f
...
@@ -39,6 +39,9 @@
...
@@ -39,6 +39,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
openal32
);
WINE_DEFAULT_DEBUG_CHANNEL
(
openal32
);
static
ALCboolean
(
ALC_APIENTRY
*
alcSetThreadContext
)(
ALCcontext
*
context
);
static
ALCcontext
*
(
ALC_APIENTRY
*
alcGetThreadContext
)(
ALCvoid
);
static
ALboolean
loaded_procs
;
static
ALboolean
loaded_procs
;
static
ALvoid
(
AL_APIENTRY
*
alBufferDataStatic
)(
const
ALuint
bid
,
ALenum
format
,
const
ALvoid
*
data
,
ALsizei
size
,
ALsizei
freq
);
static
ALvoid
(
AL_APIENTRY
*
alBufferDataStatic
)(
const
ALuint
bid
,
ALenum
format
,
const
ALvoid
*
data
,
ALsizei
size
,
ALsizei
freq
);
...
@@ -103,6 +106,10 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
...
@@ -103,6 +106,10 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
{
case
DLL_PROCESS_ATTACH
:
case
DLL_PROCESS_ATTACH
:
DisableThreadLibraryCalls
(
hinst
);
DisableThreadLibraryCalls
(
hinst
);
#define LOADFUNC(x) x = alcGetProcAddress(NULL, #x)
LOADFUNC
(
alcSetThreadContext
);
LOADFUNC
(
alcGetThreadContext
);
#undef LOADFUNC
break
;
break
;
}
}
...
@@ -110,6 +117,46 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
...
@@ -110,6 +117,46 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
}
}
static
void
LoadProcs
(
void
)
{
#define LOADFUNC(x) x = alGetProcAddress(#x)
LOADFUNC
(
alBufferDataStatic
);
LOADFUNC
(
alGenFilters
);
LOADFUNC
(
alDeleteFilters
);
LOADFUNC
(
alIsFilter
);
LOADFUNC
(
alFilterf
);
LOADFUNC
(
alFilterfv
);
LOADFUNC
(
alFilteri
);
LOADFUNC
(
alFilteriv
);
LOADFUNC
(
alGetFilterf
);
LOADFUNC
(
alGetFilterfv
);
LOADFUNC
(
alGetFilteri
);
LOADFUNC
(
alGetFilteriv
);
LOADFUNC
(
alGenEffects
);
LOADFUNC
(
alDeleteEffects
);
LOADFUNC
(
alIsEffect
);
LOADFUNC
(
alEffectf
);
LOADFUNC
(
alEffectfv
);
LOADFUNC
(
alEffecti
);
LOADFUNC
(
alEffectiv
);
LOADFUNC
(
alGetEffectf
);
LOADFUNC
(
alGetEffectfv
);
LOADFUNC
(
alGetEffecti
);
LOADFUNC
(
alGetEffectiv
);
LOADFUNC
(
alGenAuxiliaryEffectSlots
);
LOADFUNC
(
alDeleteAuxiliaryEffectSlots
);
LOADFUNC
(
alIsAuxiliaryEffectSlot
);
LOADFUNC
(
alAuxiliaryEffectSlotf
);
LOADFUNC
(
alAuxiliaryEffectSlotfv
);
LOADFUNC
(
alAuxiliaryEffectSloti
);
LOADFUNC
(
alAuxiliaryEffectSlotiv
);
LOADFUNC
(
alGetAuxiliaryEffectSlotf
);
LOADFUNC
(
alGetAuxiliaryEffectSlotfv
);
LOADFUNC
(
alGetAuxiliaryEffectSloti
);
LOADFUNC
(
alGetAuxiliaryEffectSlotiv
);
#undef LOADFUNC
}
/***********************************************************************
/***********************************************************************
* OpenAL thunk routines
* OpenAL thunk routines
*/
*/
...
@@ -133,43 +180,7 @@ ALCboolean CDECL wine_alcMakeContextCurrent(ALCcontext *context)
...
@@ -133,43 +180,7 @@ ALCboolean CDECL wine_alcMakeContextCurrent(ALCcontext *context)
if
(
context
&&
!
loaded_procs
)
if
(
context
&&
!
loaded_procs
)
{
{
loaded_procs
=
AL_TRUE
;
loaded_procs
=
AL_TRUE
;
LoadProcs
();
#define LOADFUNC(x) x = alGetProcAddress(#x)
LOADFUNC
(
alBufferDataStatic
);
LOADFUNC
(
alGenFilters
);
LOADFUNC
(
alDeleteFilters
);
LOADFUNC
(
alIsFilter
);
LOADFUNC
(
alFilterf
);
LOADFUNC
(
alFilterfv
);
LOADFUNC
(
alFilteri
);
LOADFUNC
(
alFilteriv
);
LOADFUNC
(
alGetFilterf
);
LOADFUNC
(
alGetFilterfv
);
LOADFUNC
(
alGetFilteri
);
LOADFUNC
(
alGetFilteriv
);
LOADFUNC
(
alGenEffects
);
LOADFUNC
(
alDeleteEffects
);
LOADFUNC
(
alIsEffect
);
LOADFUNC
(
alEffectf
);
LOADFUNC
(
alEffectfv
);
LOADFUNC
(
alEffecti
);
LOADFUNC
(
alEffectiv
);
LOADFUNC
(
alGetEffectf
);
LOADFUNC
(
alGetEffectfv
);
LOADFUNC
(
alGetEffecti
);
LOADFUNC
(
alGetEffectiv
);
LOADFUNC
(
alGenAuxiliaryEffectSlots
);
LOADFUNC
(
alDeleteAuxiliaryEffectSlots
);
LOADFUNC
(
alIsAuxiliaryEffectSlot
);
LOADFUNC
(
alAuxiliaryEffectSlotf
);
LOADFUNC
(
alAuxiliaryEffectSlotfv
);
LOADFUNC
(
alAuxiliaryEffectSloti
);
LOADFUNC
(
alAuxiliaryEffectSlotiv
);
LOADFUNC
(
alGetAuxiliaryEffectSlotf
);
LOADFUNC
(
alGetAuxiliaryEffectSlotfv
);
LOADFUNC
(
alGetAuxiliaryEffectSloti
);
LOADFUNC
(
alGetAuxiliaryEffectSlotiv
);
#undef LOADFUNC
}
}
LeaveCriticalSection
(
&
openal_cs
);
LeaveCriticalSection
(
&
openal_cs
);
...
@@ -846,6 +857,33 @@ ALvoid CDECL wine_alGetAuxiliaryEffectSlotiv(ALuint sid, ALenum param, ALint* va
...
@@ -846,6 +857,33 @@ ALvoid CDECL wine_alGetAuxiliaryEffectSlotiv(ALuint sid, ALenum param, ALint* va
}
}
/* Thread-local context functions */
ALCboolean
CDECL
wine_alcSetThreadContext
(
ALCcontext
*
context
)
{
EnterCriticalSection
(
&
openal_cs
);
if
(
alcSetThreadContext
(
context
)
==
ALC_FALSE
)
{
WARN
(
"Failed to make context %p current
\n
"
,
context
);
LeaveCriticalSection
(
&
openal_cs
);
return
ALC_FALSE
;
}
if
(
context
&&
!
loaded_procs
)
{
loaded_procs
=
AL_TRUE
;
LoadProcs
();
}
LeaveCriticalSection
(
&
openal_cs
);
return
ALC_TRUE
;
}
ALCcontext
*
CDECL
wine_alcGetThreadContext
(
ALCvoid
)
{
return
alcGetThreadContext
();
}
static
const
struct
FuncList
ALCFuncs
[]
=
{
static
const
struct
FuncList
ALCFuncs
[]
=
{
{
"alcCreateContext"
,
wine_alcCreateContext
},
{
"alcCreateContext"
,
wine_alcCreateContext
},
{
"alcMakeContextCurrent"
,
wine_alcMakeContextCurrent
},
{
"alcMakeContextCurrent"
,
wine_alcMakeContextCurrent
},
...
@@ -867,6 +905,8 @@ static const struct FuncList ALCFuncs[] = {
...
@@ -867,6 +905,8 @@ static const struct FuncList ALCFuncs[] = {
{
"alcCaptureStart"
,
wine_alcCaptureStart
},
{
"alcCaptureStart"
,
wine_alcCaptureStart
},
{
"alcCaptureStop"
,
wine_alcCaptureStop
},
{
"alcCaptureStop"
,
wine_alcCaptureStop
},
{
"alcCaptureSamples"
,
wine_alcCaptureSamples
},
{
"alcCaptureSamples"
,
wine_alcCaptureSamples
},
{
"alcSetThreadContext"
,
wine_alcSetThreadContext
},
{
"alcGetThreadContext"
,
wine_alcGetThreadContext
},
{
NULL
,
NULL
}
{
NULL
,
NULL
}
};
};
static
const
struct
FuncList
ALFuncs
[]
=
{
static
const
struct
FuncList
ALFuncs
[]
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment