202
edits
BrettWilson (talk | contribs) |
BrettWilson (talk | contribs) (3D API skeleton) |
||
Line 266: | Line 266: | ||
device2d->flushContext(npp, &context);</pre> | device2d->flushContext(npp, &context);</pre> | ||
=== 3D Rendering === | |||
==== Overview ==== | |||
The details of 3D rendering are still being worked out. The general idea is that there will be a serialized set of OpenGL commands sent from the plugin to the browser for display on the video card. It is currently not decided whether the format of this command stream is standardized, or whether there will be a standardized API that generates a browser-specific command stream. | |||
==== The 3D Device ==== | |||
<pre>typedef struct _NPDeviceContext3D | |||
{ | |||
void* reserved; | |||
// Buffer in which commands are stored. | |||
void* commandBuffer; | |||
int32 commandBufferEntries; | |||
// Offset in command buffer reader has reached. Synchronized on flush. | |||
int32 getOffset; | |||
// Offset in command buffer writer has reached. Synchronized on flush. | |||
int32 putOffset; | |||
} NPDeviceContext3D;</pre> | |||
The 3D device API specifies a number of state types that can be set or queried: | |||
<pre>typedef enum { | |||
/* The offset the command buffer service has read to. */ | |||
NPDeviceContext3DState_GetOffset, | |||
/* The offset the plugin instance has written to. */ | |||
NPDeviceContext3DState_PutOffset, | |||
/* The last token processed by the command buffer service. */ | |||
NPDeviceContext3DState_Token, | |||
/* The most recent parse error. Getting this value resets the parse error | |||
if it recoverable. */ | |||
NPDeviceContext3DState_ParseError, | |||
/* Wether the command buffer has encountered an unrecoverable error. */ | |||
NPDeviceContext3DState_ErrorStatus | |||
} NPDeviceContext3DState; | |||
</pre> | |||
=== NPP_SetWindow and Windowless Plugins === | === NPP_SetWindow and Windowless Plugins === |
edits