You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
(5) |
4
|
|
5
(1) |
6
(16) |
7
(3) |
8
(3) |
9
(4) |
10
(13) |
11
(5) |
|
12
(1) |
13
(1) |
14
|
15
(7) |
16
(4) |
17
(1) |
18
(1) |
|
19
(3) |
20
|
21
(1) |
22
(16) |
23
|
24
(2) |
25
|
|
26
(1) |
27
(4) |
28
(6) |
29
(3) |
30
(1) |
|
|
|
From: Elias N. <eli...@us...> - 2004-09-30 12:32:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14824/linux Modified Files: org_lwjgl_input_Mouse.c Log Message: Linux: improved cursor position tracking Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_input_Mouse.c 28 Sep 2004 13:02:38 -0000 1.14 +++ org_lwjgl_input_Mouse.c 30 Sep 2004 12:31:59 -0000 1.15 @@ -326,17 +326,13 @@ return v1 < v2 ? v1 : v2; } -void handlePointerMotion(XMotionEvent *event) { - int x = event->x; - int y = event->y; - setCursorPos(x, y); +static void doHandlePointerMotion(int root_x, int root_y, int win_x, int win_y) { + setCursorPos(win_x, win_y); if (!pointer_grabbed || !shouldGrab()) return; - int x_root = event->x_root; - int y_root = event->y_root; // find the window position in root coordinates - int win_left = x_root - x; - int win_top = y_root - y; + int win_left = root_x - win_x; + int win_top = root_y - win_y; int win_right = win_left + getWindowWidth(); int win_bottom = win_top + getWindowHeight(); // cap the window position to the screen dimensions @@ -345,8 +341,8 @@ int border_right = min(getScreenModeWidth(), win_right); int border_bottom = min(getScreenModeHeight(), win_bottom); // determine whether the cursor is outside the bounds - bool outside_limits = x_root < border_left + POINTER_WARP_BORDER || y_root < border_top + POINTER_WARP_BORDER || - x_root > border_right - POINTER_WARP_BORDER || y_root > border_bottom - POINTER_WARP_BORDER; + bool outside_limits = root_x < border_left + POINTER_WARP_BORDER || root_y < border_top + POINTER_WARP_BORDER || + root_x > border_right - POINTER_WARP_BORDER || root_y > border_bottom - POINTER_WARP_BORDER; if (outside_limits) { // Find the center of the limits in window coordinates int center_x = (border_right - border_left)/2; @@ -355,6 +351,10 @@ } } +void handlePointerMotion(XMotionEvent *event) { + doHandlePointerMotion(event->x_root, event->y_root, event->x, event->y); +} + JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { int *coords = (int *)(*env)->GetDirectBufferAddress(env, coord_buffer_obj); int coords_length = (*env)->GetDirectBufferCapacity(env, coord_buffer_obj); @@ -389,7 +389,13 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { + Window root_return, child_return; + int root_x, root_y, win_x, win_y; + unsigned int mask_return; + setGrab(new_grab == JNI_TRUE ? true : false); resetCursorToCenter(); + XQueryPointer(getDisplay(), getCurrentWindow(), &root_return, &child_return, &root_x, &root_y, &win_x, &win_y, &mask_return); + doHandlePointerMotion(root_x, root_y, win_x, win_y); accum_dx = accum_dy = 0; } |
|
From: Mark B. <cap...@us...> - 2004-09-29 02:08:14
|
Update of /cvsroot/java-game-lib/LWJGL/res/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11989/res/model Added Files: BonedModelSample.xml Log Message: Bone model sample XML file. Incomplete. --- NEW FILE: BonedModelSample.xml --- <?xml version="1.0" standalone="no"?> <bonemodel xmlns="x-schema:BoneModelSchema.xml" modelname="plane" material="none" vertexcount="4" type="boned" bones="1"> <mesh> <triangle a="0" b="1" c="2" /> <triangle a="2" b="3" c="0" /> </mesh> <skin> <texcoord u="0.0" v="1.0" /> <texcoord u="1.0" v="1.0" /> <texcoord u="1.0" v="0.0" /> <texcoord u="0.0" v="0.0" /> </skin> <colors> <color red="127" green="0" blue="0" /> <color red="0" green="0" blue="127" /> <color red="0" green="127" blue="0" /> <color red="127" green="127" blue="127" /> </colors> <animation> <sequence sequencename=""> <frame> <bonematrix> <m00></m00> <m01></m01> <m02></m02> <m03></m03> <m10></m10> <m11></m11> <m12></m12> <m13></m13> <m20></m20> <m21></m21> <m22></m22> <m23></m23> <m30></m30> <m31></m31> <m32></m32> <m33></m33> </bonematrix> <time></time> <action></action> </frame> </sequence> </animation> <vertices> <vertex x="-1.0" y="1.0" z="0.0" > <weights> <bone></bone> <weight></weight> </weights> </vertex> <vertex x="1.0" y="1.0" z="0.0" > <weights> <bone></bone> <weight></weight> </weights> </vertex> <vertex x="1.0" y="-1.0" z="0.0" > <weights> <bone></bone> <weight></weight> </weights> </vertex> <vertex x="-1.0" y="-1.0" z="0.0" > <weights> <bone></bone> <weight></weight> </weights> </vertex> </vertices> </bonemodel> |
|
From: Mark B. <cap...@us...> - 2004-09-29 02:03:29
|
Update of /cvsroot/java-game-lib/LWJGL/doc/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11399/doc/templates Added Files: MeshedModelTemplate.xml BoneModelSchema.xml BonedModelTemplate.xml MeshModelSchema.xml Log Message: Templates showing the structure of the XML model files. Schemas that can be used to validate model files. --- NEW FILE: BoneModelSchema.xml --- <?xml version="1.0" standalone="no"?> <Schema name="BoneModelSchema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <AttributeType name="modelname" /> <AttributeType name="material" /> <AttributeType name="vertexcount" > <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="type" /> <AttributeType name="bones"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="a"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="b"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="c"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="adjacency"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="triangle" content="empty"> <attribute type="a" /> <attribute type="b" /> <attribute type="c" /> <attribute type="adjacency" /> </ElementType> <ElementType name="mesh" content="eltOnly"> <element type="triangle" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="u"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="v"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="texcoord" content="empty"> <attribute type="u" /> <attribute type="v" /> </ElementType> <ElementType name="skin" content="eltOnly"> <element type="texcoord" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="red"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="green"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="blue"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="alpha"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="color" content="empty"> <attribute type="red" /> <attribute type="green" /> <attribute type="blue" /> <attribute type="alpha" /> </ElementType> <ElementType name="colors" content="eltOnly"> <element type="color" minOccurs="1" maxOccurs="*" /> </ElementType> <ElementType name="m00" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m01" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m02" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m03" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m10" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m11" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m12" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m13" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m20" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m21" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m22" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m23" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m30" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m31" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m32" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="m33" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="bonematrix" content="eltOnly"> <element type="m00" minOccurs="1" maxOccurs="1" /> <element type="m01" minOccurs="1" maxOccurs="1" /> <element type="m02" minOccurs="1" maxOccurs="1" /> <element type="m03" minOccurs="1" maxOccurs="1" /> <element type="m10" minOccurs="1" maxOccurs="1" /> <element type="m11" minOccurs="1" maxOccurs="1" /> <element type="m12" minOccurs="1" maxOccurs="1" /> <element type="m13" minOccurs="1" maxOccurs="1" /> <element type="m20" minOccurs="1" maxOccurs="1" /> <element type="m21" minOccurs="1" maxOccurs="1" /> <element type="m22" minOccurs="1" maxOccurs="1" /> <element type="m23" minOccurs="1" maxOccurs="1" /> <element type="m30" minOccurs="0" maxOccurs="1" /> <element type="m31" minOccurs="0" maxOccurs="1" /> <element type="m32" minOccurs="0" maxOccurs="1" /> <element type="m33" minOccurs="0" maxOccurs="1" /> </ElementType> <ElementType name="time" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="action" content="textOnly" /> <AttributeType name="sequencename" /> <ElementType name="frame" content="eltOnly"> <element type="bonematrix" minOccurs="1" maxOccurs="*" /> <element type="time" minOccurs="1" maxOccurs="1" /> <element type="action" minOccurs="1" maxOccurs="1" /> </ElementType> <ElementType name="sequence" content="eltOnly"> <attribute type="sequencename" /> <element type="frame" minOccurs="1" maxOccurs="*" /> </ElementType> <ElementType name="animation" content="eltOnly"> <element type="sequence" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="x"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="y"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="z"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="nx"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="ny"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="nz"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <ElementType name="bone" content="textOnly"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </ElementType> <ElementType name="weight" content="textOnly"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </ElementType> <ElementType name="weights" content="eltOnly"> <element type="bone" minOccurs="1" maxOccurs="1" /> <element type="weight" minOccurs="1" maxOccurs="1" /> </ElementType> <ElementType name="vertex" content="eltOnly"> <attribute type="x" /> <attribute type="y" /> <attribute type="z" /> <attribute type="nx" /> <attribute type="ny" /> <attribute type="nz" /> <element type="weights" minOccurs="1" maxOccurs="1" /> </ElementType> <ElementType name="vertices" content="eltOnly"> <element type="vertex" minOccurs="1" maxOccurs="*" /> </ElementType> <ElementType name="meshmodel" content="eltOnly"> <attribute type="modelname" /> <attribute type="material" /> <attribute type="vertexcount" /> <attribute type="type" /> <attribute type="bones" /> <element type="mesh" minOccurs="1" maxOccurs="1" /> <element type="skin" minOccurs="1" maxOccurs="1" /> <element type="colors" minOccurs="1" maxOccurs="1" /> <element type="animation" minOccurs="1" maxOccurs="1" /> <element type="vertices" minOccurs="1" maxOccurs="1" /> </ElementType> </Schema> --- NEW FILE: BonedModelTemplate.xml --- <?xml version="1.0" standalone="no"?> <bonemodel xmlns="x-schema:BoneModelSchema.xml" modelname="" material="" vertexcount="" type="" bones=""> <mesh> <triangle a="" b="" c="" adjacency="" /> </mesh> <skin> <texcoord u="" v="" /> </skin> <colors> <color red="" green="" blue="" alpha=""/> </colors> <animation> <sequence sequencename=""> <frame> <bonematrix> <m00></m00> <m01></m01> <m02></m02> <m03></m03> <m10></m10> <m11></m11> <m12></m12> <m13></m13> <m20></m20> <m21></m21> <m22></m22> <m23></m23> <m30></m30> <m31></m31> <m32></m32> <m33></m33> </bonematrix> <time></time> <action></action> </frame> </sequence> </animation> <vertices> <vertex x="" y="" z="" nx="" ny="" nz=""> <weights> <bone></bone> <weight></weight> </weights> </vertex> </vertices> </bonemodel> --- NEW FILE: MeshModelSchema.xml --- <?xml version="1.0" standalone="no"?> <Schema name="MeshModelSchema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <AttributeType name="modelname" /> <AttributeType name="material" /> <AttributeType name="vertexcount" > <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="type" /> <ElementType name="bones" content="textOnly"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </ElementType> <AttributeType name="a"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="b"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="c"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="adjacency"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="triangle" content="empty"> <attribute type="a" /> <attribute type="b" /> <attribute type="c" /> <attribute type="adjacency" /> </ElementType> <ElementType name="mesh" content="eltOnly"> <element type="triangle" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="u"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="v"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="texcoord" content="empty"> <attribute type="u" /> <attribute type="v" /> </ElementType> <ElementType name="skin" content="eltOnly"> <element type="texcoord" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="red"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="green"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="blue"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <AttributeType name="alpha"> <description> This element will be converted into an integer, so it should only contain whole numbers. </description> </AttributeType> <ElementType name="color" content="empty"> <attribute type="red" /> <attribute type="green" /> <attribute type="blue" /> <attribute type="alpha" /> </ElementType> <ElementType name="colors" content="eltOnly"> <element type="color" minOccurs="1" maxOccurs="*" /> </ElementType> <AttributeType name="x"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="y"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="z"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="nx"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="ny"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <AttributeType name="nz"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <ElementType name="vertex" content="empty"> <attribute type="x" /> <attribute type="y" /> <attribute type="z" /> <attribute type="nx" /> <attribute type="ny" /> <attribute type="nz" /> </ElementType> <AttributeType name="time"> <description> This element will be converted into an floating point number, so it should only contain decimal numbers. </description> </AttributeType> <ElementType name="action" content="textOnly" /> <AttributeType name="sequencename" /> <ElementType name="frame" content="eltOnly"> <element type="vertex" minOccurs="1" maxOccurs="*" /> <attribute type="time" /> <element type="action" minOccurs="1" maxOccurs="1" /> </ElementType> <ElementType name="sequence" content="eltOnly"> <attribute type="sequencename" /> <element type="frame" minOccurs="1" maxOccurs="*" /> </ElementType> <ElementType name="animation" content="eltOnly"> <element type="sequence" minOccurs="1" maxOccurs="*" /> </ElementType> <ElementType name="meshmodel" content="eltOnly"> <attribute type="modelname" /> <attribute type="material" /> <attribute type="vertexcount" /> <attribute type="type" /> <element type="mesh" minOccurs="1" maxOccurs="1" /> <element type="skin" minOccurs="0" maxOccurs="1" /> <element type="colors" minOccurs="1" maxOccurs="1" /> <element type="animation" minOccurs="1" maxOccurs="1" /> </ElementType> </Schema> --- NEW FILE: MeshedModelTemplate.xml --- <?xml version="1.0" standalone="no"?> <meshmodel xmlns="x-schema:MeshModelSchema.xml" modelname="" material="" vertexcount="" type=""> <mesh> <triangle a="" b="" c="" adjacency="" /> </mesh> <skin> <texcoord u="" v="" /> </skin> <colors> <color red="" green="" blue="" alpha=""/> </colors> <animation> <sequence sequencename=""> <frame time=""> <vertex x="" y="" z="" nx="" ny="" nz=""/> <action></action> </frame> </sequence> </animation> </meshmodel> |
|
From: Mark B. <cap...@us...> - 2004-09-29 01:57:27
|
Update of /cvsroot/java-game-lib/LWJGL/res/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10213/res/model Added Files: MeshedModelSample.xml Log Message: Sample showing the structure of the XML model files. --- NEW FILE: MeshedModelSample.xml --- <?xml version="1.0" standalone="no"?> <meshmodel xmlns="x-schema:MeshModelSchema.xml" modelname="example" material="test" vertexcount="4" type="meshed"> <mesh> <triangle a="0" b="1" c="2" /> <triangle a="2" b="3" c="0" /> </mesh> <skin> <texcoord u="0.0" v="1.0" /> <texcoord u="1.0" v="1.0" /> <texcoord u="1.0" v="0.0" /> <texcoord u="0.0" v="0.0" /> </skin> <colors> <color red="127" green="0" blue="0" /> <color red="0" green="0" blue="127" /> <color red="0" green="127" blue="0" /> <color red="127" green="127" blue="127" /> </colors> <animation> <sequence sequencename="plane"> <frame time="1.0"> <vertex x="-1.0" y="1.0" z="0.0" /> <vertex x="1.0" y="1.0" z="0.0" /> <vertex x="1.0" y="-1.0" z="0.0" /> <vertex x="-1.0" y="-1.0" z="0.0" /> <action></action> </frame> <frame time="5.0"> <vertex x="1.0" y="1.0" z="0.0" /> <vertex x="-1.0" y="1.0" z="0.0" /> <vertex x="-1.0" y="-1.0" z="0.0" /> <vertex x="1.0" y="-1.0" z="0.0" /> <action></action> </frame> </sequence> </animation> </meshmodel> |
|
From: Mark B. <cap...@us...> - 2004-09-28 22:12:37
|
Update of /cvsroot/java-game-lib/LWJGL/doc/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28866/doc/templates Log Message: Directory /cvsroot/java-game-lib/LWJGL/doc/templates added to the repository |
|
From: Mark B. <cap...@us...> - 2004-09-28 22:11:58
|
Update of /cvsroot/java-game-lib/LWJGL/res/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28755/res/model Log Message: Directory /cvsroot/java-game-lib/LWJGL/res/model added to the repository |
|
From: Mark B. <cap...@us...> - 2004-09-28 22:10:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/model/loaders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28437/src/java/org/lwjgl/util/model/loaders Modified Files: XMLLoader.java Log Message: Update tag names to prevent conflicts when validating XML files. Index: XMLLoader.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/model/loaders/XMLLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XMLLoader.java 12 Jun 2004 20:28:28 -0000 1.3 +++ XMLLoader.java 28 Sep 2004 22:10:39 -0000 1.4 @@ -78,9 +78,9 @@ * @throws Exception */ public Model load() throws Exception { - String name = XMLUtil.getString(src.getDocumentElement(), "name"); + String name = XMLUtil.getString(src.getDocumentElement(), "modelname"); String material = XMLUtil.getString(src.getDocumentElement(), "material"); - numVertices = XMLUtil.getInt(src.getDocumentElement(), "vertices"); + numVertices = XMLUtil.getInt(src.getDocumentElement(), "vertexcount"); if (XMLUtil.getString(src.getDocumentElement(), "type").equals("boned")) { // It's a boned model numBones = XMLUtil.getInt(src.getDocumentElement(), "bones", 0); @@ -218,7 +218,7 @@ Map animations = new HashMap(sequenceElements.size()); for (Iterator i = sequenceElements.iterator(); i.hasNext(); ) { Element sequenceElement = (Element) i.next(); - animations.put(XMLUtil.getString(sequenceElement, "name"), loadBonedAnimation(sequenceElement)); + animations.put(XMLUtil.getString(sequenceElement, "sequencename"), loadBonedAnimation(sequenceElement)); } return animations; } @@ -233,11 +233,11 @@ if (animationElement == null) { return null; } - List sequenceElements = XMLUtil.getChildren(src.getDocumentElement(), "sequence"); + List sequenceElements = XMLUtil.getChildren(animationElement, "sequence"); Map animations = new HashMap(sequenceElements.size()); for (Iterator i = sequenceElements.iterator(); i.hasNext(); ) { Element sequenceElement = (Element) i.next(); - animations.put(XMLUtil.getString(sequenceElement, "name"), loadMeshAnimation(sequenceElement)); + animations.put(XMLUtil.getString(sequenceElement, "sequencename"), loadMeshAnimation(sequenceElement)); } return animations; } @@ -372,10 +372,10 @@ */ private Color loadColor(Element element) throws Exception { return new Color( - XMLUtil.getInt(element, "r"), - XMLUtil.getInt(element, "g"), - XMLUtil.getInt(element, "b"), - XMLUtil.getInt(element, "a", 255) + XMLUtil.getInt(element, "red"), + XMLUtil.getInt(element, "green"), + XMLUtil.getInt(element, "blue"), + XMLUtil.getInt(element, "alpha", 255) ); } |
|
From: Ioannis T. <sp...@us...> - 2004-09-28 13:45:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9985 Added Files: EXTCgShader.java Log Message: Added EXT_Cg_shader constants --- NEW FILE: EXTCgShader.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; public final class EXTCgShader { /** * You can pass GL_CG_VERTEX_SHADER_EXT to glCreateShaderARB instead of GL_VERTEX_SHADER_ARB to create a vertex shader object * that will parse and compile its shader source with the Cg compiler front-end rather than the GLSL front-end. Likewise, you * can pass GL_CG_FRAGMENT_SHADER_EXT to glCreateShaderARB instead of GL_FRAGMENT_SHADER_ARB to create a fragment shader object * that will parse and compile its shader source with the Cg front-end rather than the GLSL front-end. */ public static final int GL_CG_VERTEX_SHADER_EXT = 0x890E; public static final int GL_CG_FRAGMENT_SHADER_EXT = 0x890F; private EXTCgShader() { } } |
|
From: Elias N. <eli...@us...> - 2004-09-28 13:02:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1238/linux Modified Files: org_lwjgl_input_Mouse.c Log Message: Linux: Don't warp cursor position at Mouse.create() Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_input_Mouse.c 27 Sep 2004 13:20:27 -0000 1.13 +++ org_lwjgl_input_Mouse.c 28 Sep 2004 13:02:38 -0000 1.14 @@ -239,6 +239,10 @@ return NUM_BUTTONS; } +static void resetCursorToCenter(void) { + resetCursor(getWindowWidth()/2, transformY(getWindowHeight()/2)); +} + JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { @@ -247,6 +251,7 @@ return; int i; last_z = last_poll_y = last_poll_x = last_event_x = last_event_y = accum_dx = accum_dy = accum_dz = 0; + resetCursorToCenter(); for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; if (!blankCursor()) { @@ -260,7 +265,6 @@ buffer_enabled = false; updatePointerGrab(); initEventQueue(&event_queue, 5); - doWarpPointer(getWindowWidth()/2, getWindowHeight()/2); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy @@ -386,6 +390,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { setGrab(new_grab == JNI_TRUE ? true : false); - resetCursor(getWindowWidth()/2, transformY(getWindowHeight()/2)); + resetCursorToCenter(); accum_dx = accum_dy = 0; } |
|
From: Brian M. <ma...@us...> - 2004-09-28 06:10:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18721/src/java/org/lwjgl/fmod3 Modified Files: FSound.java Log Message: set native order before retuning float buffer Index: FSound.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FSound.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- FSound.java 27 Sep 2004 15:17:05 -0000 1.9 +++ FSound.java 28 Sep 2004 06:10:46 -0000 1.10 @@ -32,6 +32,7 @@ package org.lwjgl.fmod3; import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.ArrayList; @@ -3137,7 +3138,7 @@ * @return FloatBuffer containing 512 floats */ public static FloatBuffer FSOUND_DSP_GetSpectrum() { - return nFSOUND_DSP_GetSpectrum().asFloatBuffer(); + return nFSOUND_DSP_GetSpectrum().order(ByteOrder.nativeOrder()).asFloatBuffer(); } private static native ByteBuffer nFSOUND_DSP_GetSpectrum(); |
|
From: Brian M. <ma...@us...> - 2004-09-27 15:17:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27331/src/java/org/lwjgl/fmod3 Modified Files: FSound.java Log Message: fix spectrum to return a float buffer Index: FSound.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FSound.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- FSound.java 16 Sep 2004 21:11:22 -0000 1.8 +++ FSound.java 27 Sep 2004 15:17:05 -0000 1.9 @@ -3137,12 +3137,9 @@ * @return FloatBuffer containing 512 floats */ public static FloatBuffer FSOUND_DSP_GetSpectrum() { - if(FMOD.fmodFFTBuffer == null) { - FMOD.fmodFFTBuffer = nFSOUND_DSP_GetSpectrum(); - } - return FMOD.fmodFFTBuffer; + return nFSOUND_DSP_GetSpectrum().asFloatBuffer(); } - private static native FloatBuffer nFSOUND_DSP_GetSpectrum(); + private static native ByteBuffer nFSOUND_DSP_GetSpectrum(); /** * Allows the user to mix their own data from one buffer to another, using FSOUNDs optimized |
|
From: Elias N. <eli...@us...> - 2004-09-27 13:43:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7348/src/native/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Fix win32 mouse event deltas too Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- org_lwjgl_input_Mouse.cpp 22 Sep 2004 17:54:27 -0000 1.63 +++ org_lwjgl_input_Mouse.cpp 27 Sep 2004 13:43:34 -0000 1.64 @@ -62,8 +62,10 @@ static int accum_dx; static int accum_dy; static int accum_dwheel; -static int last_x; -static int last_y; +static int last_poll_x; +static int last_poll_y; +static int last_event_x; +static int last_event_y; static event_queue_t event_queue; static bool buffer_enabled; @@ -77,22 +79,19 @@ void InitializeMouseFields(); void UpdateMouseFields(JNIEnv *env, jclass clsMouse, jobject coord_buffer_obj, jobject button_buffer_obj); -static void putEvent(jint button, jint state, jint dx, jint dy, jint dz) { - if (buffer_enabled) { - putEventElement(&event_queue, button); - putEventElement(&event_queue, state); - putEventElement(&event_queue, dx); - putEventElement(&event_queue, -dy); - putEventElement(&event_queue, dz); - } +static bool putMouseEvent(jint button, jint state, jint dx, jint dy, jint dz) { + jint event[] = {button, state, dx, -dy, dz}; + return putEvent(&event_queue, event); } static void resetCursorPos(void) { /* Reset cursor position to middle of the window */ RECT clientRect; GetClientRect(getCurrentHWND(), &clientRect); - last_x = (clientRect.left + clientRect.right)/2; - last_y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; + last_poll_x = (clientRect.left + clientRect.right)/2; + last_poll_y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; + last_event_x = last_poll_x; + last_event_y = last_poll_y; accum_dx = accum_dy = 0; } @@ -110,9 +109,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { HRESULT hr; - initEventQueue(&event_queue); + initEventQueue(&event_queue, 5); - last_x = last_y = accum_dx = accum_dy = accum_dwheel = 0; + last_poll_x = last_poll_y = last_event_x = last_event_y = accum_dx = accum_dy = accum_dwheel = 0; buffer_enabled = false; // Create input @@ -156,21 +155,26 @@ void handleMouseScrolled(int event_dwheel) { accum_dwheel += event_dwheel; - putEvent(-1, 0, 0, 0, event_dwheel); + putMouseEvent(-1, 0, 0, 0, event_dwheel); } void handleMouseMoved(int x, int y) { - int event_dx = x - last_x; - int event_dy = y - last_y; - accum_dx += event_dx; - accum_dy += event_dy; - putEvent(-1, 0, event_dx, event_dy, 0); - last_x = x; - last_y = y; + int poll_dx = x - last_poll_x; + int poll_dy = y - last_poll_y; + accum_dx += poll_dx; + accum_dy += poll_dy; + last_poll_x = x; + last_poll_y = y; + int event_dx = x - last_event_x; + int event_dy = y - last_event_y; + if (putMouseEvent(-1, 0, event_dx, event_dy, 0)) { + last_event_x = x; + last_event_y = y; + } } void handleMouseButton(int button, int state) { - putEvent(button, state, 0, 0, 0); + putMouseEvent(button, state, 0, 0, 0); } static void copyDXEvents(int num_di_events, DIDEVICEOBJECTDATA *di_buffer) { @@ -180,19 +184,19 @@ int button_state = (di_buffer[i].dwData & 0x80) != 0 ? 1 : 0; switch (di_buffer[i].dwOfs) { case DIMOFS_BUTTON0: - putEvent(0, button_state, dx, dy, dwheel); + putMouseEvent(0, button_state, dx, dy, dwheel); dx = dy = dwheel = 0; break; case DIMOFS_BUTTON1: - putEvent(1, button_state, dx, dy, dwheel); + putMouseEvent(1, button_state, dx, dy, dwheel); dx = dy = dwheel = 0; break; case DIMOFS_BUTTON2: - putEvent(2, button_state, dx, dy, dwheel); + putMouseEvent(2, button_state, dx, dy, dwheel); dx = dy = dwheel = 0; break; case DIMOFS_BUTTON3: - putEvent(3, button_state, dx, dy, dwheel); + putMouseEvent(3, button_state, dx, dy, dwheel); dx = dy = dwheel = 0; break; case DIMOFS_X: @@ -207,7 +211,7 @@ } } if (dx != 0 || dy != 0 || dwheel != 0) - putEvent(-1, 0, dx, dy, dwheel); + putMouseEvent(-1, 0, dx, dy, dwheel); } static void readDXBuffer() @@ -257,7 +261,7 @@ } else { handleMessages(); } - return copyEvents(&event_queue, buffer_ptr, buffer_size, 5); + return copyEvents(&event_queue, buffer_ptr, buffer_size); } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps |
|
From: Elias N. <eli...@us...> - 2004-09-27 13:20:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1328/common Modified Files: common_tools.c common_tools.h Log Message: Track event mouse deltas even when the event queue overflows Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- common_tools.c 22 Sep 2004 11:08:20 -0000 1.3 +++ common_tools.c 27 Sep 2004 13:20:27 -0000 1.4 @@ -78,46 +78,64 @@ va_end(ap); } -static void incListStart(event_queue_t *queue) { - queue->list_start = (queue->list_start + 1)%EVENT_BUFFER_SIZE; +int getElementCapacity(event_queue_t *queue) { + return queue->limit - queue->position; } -void initEventQueue(event_queue_t *event_queue) { - event_queue->list_start = 0; - event_queue->list_end = 0; +void initEventQueue(event_queue_t *queue, int event_size) { + queue->position = 0; + queue->limit = EVENT_BUFFER_SIZE; + queue->event_size = event_size; } -void putEventElement(event_queue_t *queue, jint s) { - int next_index = (queue->list_end + 1)%EVENT_BUFFER_SIZE; - if (next_index == queue->list_start) { +bool putEvent(event_queue_t *queue, jint *event) { + int i; + if (getElementCapacity(queue) < queue->event_size) { printfDebug("Event buffer overflow!\n"); - return; + return false; } - queue->input_event_buffer[queue->list_end] = s; - queue->list_end = next_index; + for (i = 0; i < queue->event_size; i++) { + queue->input_event_buffer[queue->position] = event[i]; + queue->position++; + } + return true; } -static bool hasMoreEvents(event_queue_t *queue) { - return queue->list_start != queue->list_end; +static void flip(event_queue_t *queue) { + queue->limit = queue->position; + queue->position = 0; } -static void copyEvent(event_queue_t *queue, jint *output_event_buffer, int output_index, int event_size) { +static void compact(event_queue_t *queue) { + int new_position = 0; + while (getElementCapacity(queue) > 0) { + queue->input_event_buffer[new_position] = queue->input_event_buffer[queue->position]; + queue->position++; + new_position++; + } + queue->position = new_position; + queue->limit = EVENT_BUFFER_SIZE; +} + +static void copyEvent(event_queue_t *queue, jint *output_event_buffer, int output_index) { int i; - for (i = 0; i < event_size; i++) { - output_event_buffer[output_index] = queue->input_event_buffer[queue->list_start]; - incListStart(queue); + for (i = 0; i < queue->event_size; i++) { + output_event_buffer[output_index] = queue->input_event_buffer[queue->position]; + queue->position++; output_index++; } } -int copyEvents(event_queue_t *event_queue, jint *output_event_buffer, int buffer_size, int event_size) { +int copyEvents(event_queue_t *queue, jint *output_event_buffer, int buffer_size) { int num_events = 0; int index = 0; - while (index + event_size <= buffer_size && hasMoreEvents(event_queue)) { - copyEvent(event_queue, output_event_buffer, index, event_size); + flip(queue); + while (index + queue->event_size <= buffer_size && getElementCapacity(queue) >= queue->event_size) { + copyEvent(queue, output_event_buffer, index); num_events++; - index += event_size; + index += queue->event_size; } + compact(queue); return num_events; } Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- common_tools.h 22 Sep 2004 11:08:21 -0000 1.23 +++ common_tools.h 27 Sep 2004 13:20:27 -0000 1.24 @@ -46,15 +46,14 @@ // shared VM instance extern JavaVM *jvm; -// Must be x * max_event_size + 1 -#define EVENT_BUFFER_SIZE (25 * 4 + 1) +#define EVENT_BUFFER_SIZE 256 #define ATTRIB_LIST_SIZE (256) typedef struct { + int event_size; + int position; + int limit; jint input_event_buffer[EVENT_BUFFER_SIZE]; - - int list_start; - int list_end; } event_queue_t; typedef struct { @@ -124,9 +123,9 @@ extern bool isDebugEnabled(void); extern jstring getVersionString(JNIEnv *env); -extern void initEventQueue(event_queue_t *event_queue); -extern int copyEvents(event_queue_t *event_queue, jint *output_event_buffer, int buffer_size, int event_size); -extern void putEventElement(event_queue_t *queue, jint byte); +extern void initEventQueue(event_queue_t *event_queue, int event_size); +extern int copyEvents(event_queue_t *event_queue, jint *output_event_buffer, int buffer_size); +extern bool putEvent(event_queue_t *queue, jint *event); extern void throwException(JNIEnv *env, const char *msg); extern void throwOpenALException(JNIEnv * env, const char * err); extern void throwFMODException(JNIEnv * env, const char * err); |
|
From: Elias N. <eli...@us...> - 2004-09-27 13:20:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1328/linux Modified Files: org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c Log Message: Track event mouse deltas even when the event queue overflows Index: org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_input_Keyboard.c 22 Sep 2004 11:08:21 -0000 1.6 +++ org_lwjgl_input_Keyboard.c 27 Sep 2004 13:20:27 -0000 1.7 @@ -120,7 +120,7 @@ keyboard_grabbed = false; translation_enabled = false; buffer_enabled = false; - initEventQueue(&event_queue); + initEventQueue(&event_queue, 3); updateKeyboardGrab(); } @@ -138,14 +138,19 @@ return keycode; } -static int translateEvent(XKeyEvent *event) { +static void putKeyboardEvent(jint keycode, jint state, jint ch) { + int event_list[] = {keycode, state, ch}; + putEvent(&event_queue, event_list); +} + +static int translateEvent(XKeyEvent *event, jint keycode, jint state) { static char temp_translation_buffer[KEYBOARD_BUFFER_SIZE]; static XComposeStatus status; int num_chars, i; jint ch; if (!translation_enabled || event->type == KeyRelease) { - putEventElement(&event_queue, 0); + putKeyboardEvent(keycode, state, 0); return 0; } num_chars = XLookupString(event, temp_translation_buffer, KEYBOARD_BUFFER_SIZE, NULL, &status); @@ -153,15 +158,13 @@ num_chars--; /* Assume little endian byte order */ ch = (jint)temp_translation_buffer[0] & 0xFF; - putEventElement(&event_queue, ch); + putKeyboardEvent(keycode, state, ch); for (i = 0; i < num_chars; i++) { - putEventElement(&event_queue, 0); - putEventElement(&event_queue, 0); ch = ((jint)temp_translation_buffer[i + 1]) & 0xFF; - putEventElement(&event_queue, ch); + putKeyboardEvent(0, 0, ch); } } else { - putEventElement(&event_queue, 0); + putKeyboardEvent(keycode, state, 0); } return num_chars; } @@ -179,9 +182,7 @@ unsigned char keycode = getKeycode(key_event); unsigned char state = eventState(key_event); //printf("Reading a key %d %d count %d\n", (int)keycode, (int)state, num_events); - putEventElement(&event_queue, keycode); - putEventElement(&event_queue, state); - translateEvent(key_event); + translateEvent(key_event, keycode, state); } void handleKeyEvent(XKeyEvent *event) { @@ -199,11 +200,10 @@ } JNIEXPORT int JNICALL Java_org_lwjgl_input_Keyboard_nRead(JNIEnv * env, jclass clazz, jobject buffer, jint buffer_position) { - int event_size = 3; handleMessages(); jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer))/sizeof(jint) - buffer_position; - return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, event_size); + return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation(JNIEnv *env, jclass clazz) { Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_input_Mouse.c 22 Sep 2004 18:35:14 -0000 1.12 +++ org_lwjgl_input_Mouse.c 27 Sep 2004 13:20:27 -0000 1.13 @@ -53,7 +53,6 @@ #define NUM_BUTTONS 3 #define POINTER_WARP_BORDER 10 -#define WARP_RETRY 5 // scale the mouse wheel according to win32 #define WHEEL_SCALE 120 @@ -63,8 +62,11 @@ static int accum_dx; static int accum_dy; static int accum_dz; -static int last_x; -static int last_y; +static int last_poll_x; +static int last_poll_y; +static int last_event_x; +static int last_event_y; +static int last_z; static jbyte buttons[NUM_BUTTONS]; static event_queue_t event_queue; static bool buffer_enabled; @@ -72,24 +74,24 @@ static Cursor blank_cursor; static Cursor current_cursor; -static void putEvent(jint button, jint state, jint dx, jint dy, jint dz) { - if (buffer_enabled) { - putEventElement(&event_queue, button); - putEventElement(&event_queue, state); - putEventElement(&event_queue, dx); - putEventElement(&event_queue, -dy); - putEventElement(&event_queue, dz); - } +static bool putMouseEvent(jint button, jint state, jint dx, jint dy, jint dz) { + jint event[] = {button, state, dx, dy, dz}; + return putEvent(&event_queue, event); } static void setCursorPos(int x, int y) { - jint event_dx = x - last_x; - jint event_dy = y - last_y; - accum_dx += event_dx; - accum_dy += event_dy; - last_x = x; - last_y = y; - putEvent(-1, 0, event_dx, event_dy, 0); + jint poll_dx = x - last_poll_x; + jint poll_dy = y - last_poll_y; + accum_dx += poll_dx; + accum_dy += poll_dy; + last_poll_x = x; + last_poll_y = y; + jint event_dx = x - last_event_x; + jint event_dy = y - last_event_y; + if (putMouseEvent(-1, 0, event_dx, -event_dy, 0)) { + last_event_x = x; + last_event_y = y; + } } static int transformY(int y) { @@ -97,8 +99,10 @@ } static void resetCursor(int x, int y) { - last_x = x; - last_y = y; + last_poll_x = x; + last_poll_y = y; + last_event_x = x; + last_event_y = y; } static bool blankCursor(void) { @@ -242,7 +246,7 @@ if (disp == NULL) return; int i; - last_y = last_x = accum_dx = accum_dy = accum_dz = 0; + last_z = last_poll_y = last_poll_x = last_event_x = last_event_y = accum_dx = accum_dy = accum_dz = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; if (!blankCursor()) { @@ -255,7 +259,7 @@ pointer_grabbed = false; buffer_enabled = false; updatePointerGrab(); - initEventQueue(&event_queue); + initEventQueue(&event_queue, 5); doWarpPointer(getWindowWidth()/2, getWindowHeight()/2); } @@ -285,7 +289,7 @@ if (button_num == NUM_BUTTONS) return; buttons[button_num] = state; - putEvent(button_num, state, 0, 0, 0); + putMouseEvent(button_num, state, 0, 0, 0); } void handleButtonPress(XButtonEvent *event) { @@ -293,11 +297,11 @@ switch (event->button) { case Button4: delta = WHEEL_SCALE; - putEvent(-1, 0, 0, 0, delta); + putMouseEvent(-1, 0, 0, 0, delta); break; case Button5: delta = -WHEEL_SCALE; - putEvent(-1, 0, 0, 0, delta); + putMouseEvent(-1, 0, 0, 0, delta); break; default: break; @@ -377,7 +381,7 @@ jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer))/sizeof(jint) - buffer_position; handleMessages(); - return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, 5); + return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { |
|
From: Brian M. <ma...@us...> - 2004-09-26 20:24:25
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28768 Modified Files: documentation.php Log Message: link to the wiki! Index: documentation.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/documentation.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- documentation.php 21 Jun 2004 21:55:20 -0000 1.3 +++ documentation.php 26 Sep 2004 20:24:12 -0000 1.4 @@ -22,6 +22,7 @@ </p> <p> <a href="/https/sourceforge.net/javadoc" target="_blank">LWJGL javadoc</a><br><br> + <a href="http://lwjgl.org/wiki/tiki-index.php">LWJGL Wiki</a><br><br> <a href="?page=tutorials/openal/devmaster/lesson1">Using OpenAL</a> </p> </div> |
|
From: Brian M. <ma...@us...> - 2004-09-24 15:28:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv794/src/java/org/lwjgl/test/fmod3 Modified Files: StreamPlayerMemory.java Log Message: miscellaneous updates Index: StreamPlayerMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/StreamPlayerMemory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- StreamPlayerMemory.java 24 Sep 2004 06:08:27 -0000 1.1 +++ StreamPlayerMemory.java 24 Sep 2004 15:28:29 -0000 1.2 @@ -33,8 +33,6 @@ import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -53,7 +51,7 @@ public static void main(String[] args) { if (args.length < 1) { - System.out.println("Usage:\n StreamPlayer <file>"); + System.out.println("Usage:\n StreamPlayerMemory <file>"); // default to phero-eveningtest.mp3 args = new String[] { "phero-eveningtest.mp3" }; @@ -82,11 +80,11 @@ // busy wait until done int length = FSound.FSOUND_Stream_GetLengthMs(stream); - System.out.println("Loaded song of length: " + ((length / 1000) / 60) + "m " + ((length / 1000) % 60) + "s"); - System.out.println("Waiting 60 seconds, for song to finish"); + String time = ((length / 1000) / 60) + "m " + ((length / 1000) % 60) + "s"; + System.out.println("Waiting " + time + ", for song to finish"); try { - Thread.sleep(60000); + Thread.sleep(length); } catch (InterruptedException inte) { } |
|
From: Brian M. <ma...@us...> - 2004-09-24 06:08:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11833/src/java/org/lwjgl/test/fmod3 Added Files: StreamPlayerMemory.java Log Message: StreamPlayerMemory testing playing of in memory mp3 file --- NEW FILE: StreamPlayerMemory.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.fmod3; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import org.lwjgl.fmod3.FMOD; import org.lwjgl.fmod3.FMODException; import org.lwjgl.fmod3.FSound; import org.lwjgl.fmod3.FSoundStream; /** * $Id: StreamPlayerMemory.java,v 1.1 2004/09/24 06:08:27 matzon Exp $ <br> * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class StreamPlayerMemory { public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage:\n StreamPlayer <file>"); // default to phero-eveningtest.mp3 args = new String[] { "phero-eveningtest.mp3" }; System.out.println("Using default: " + args[0]); } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); return; } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); return; } ByteBuffer data = getData(args[0]); FSoundStream stream = FSound.FSOUND_Stream_Open(data, FSound.FSOUND_LOADMEMORY, 0, data.capacity()); if (stream != null) { FSound.FSOUND_Stream_Play(0, stream); // busy wait until done int length = FSound.FSOUND_Stream_GetLengthMs(stream); System.out.println("Loaded song of length: " + ((length / 1000) / 60) + "m " + ((length / 1000) % 60) + "s"); System.out.println("Waiting 60 seconds, for song to finish"); try { Thread.sleep(60000); } catch (InterruptedException inte) { } FSound.FSOUND_Stream_Stop(stream); FSound.FSOUND_Stream_Close(stream); } else { System.out.println("Unable to play: " + args[0]); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); } FSound.FSOUND_Close(); FMOD.destroy(); } /** * Reads the file into a ByteBuffer * * @param filename * Name of file to load * @return ByteBuffer containing file data */ static protected ByteBuffer getData(String filename) { ByteBuffer buffer = null; System.out.println("Attempting to load: " + filename); try { BufferedInputStream bis = new BufferedInputStream(StreamPlayerMemory.class.getClassLoader().getResourceAsStream(filename)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bufferLength = 4096; byte[] readBuffer = new byte[bufferLength]; int read = -1; while ((read = bis.read(readBuffer, 0, bufferLength)) != -1) { baos.write(readBuffer, 0, read); } //done reading, close bis.close(); // if ogg vorbis data, we need to pass it unmodified to alBufferData buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); buffer.flip(); System.out.println("loaded " + buffer.remaining() + " bytes"); } catch (Exception ioe) { ioe.printStackTrace(); } return buffer; } } |
|
From: Elias N. <eli...@us...> - 2004-09-22 19:56:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19889/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Fixed problem with updating screen dimension globals Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- display.h 22 Sep 2004 19:25:16 -0000 1.5 +++ display.h 22 Sep 2004 19:56:02 -0000 1.6 @@ -43,6 +43,7 @@ #define _DISPLAY_H #include <jni.h> +#include "common_tools.h" typedef enum {XRANDR, XF86VIDMODE, NONE} extension; @@ -50,7 +51,7 @@ extern int getScreenModeHeight(void); extern jobject initDisplay(JNIEnv *env, int screen); extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen); -extern void resetDisplayMode(int screen); +extern void resetDisplayMode(int screen, bool temporary); extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen); extern int getGammaRampLength(int screen); extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- display.c 22 Sep 2004 19:25:15 -0000 1.2 +++ display.c 22 Sep 2004 19:56:02 -0000 1.3 @@ -225,7 +225,7 @@ return true; } -static bool setMode(Display *disp, int screen, int width, int height, int freq/*, bool lock_mode*/) { +static bool setMode(Display *disp, int screen, int width, int height, int freq, bool temporary) { if (current_extension == NONE) return false; int num_modes, i; @@ -256,6 +256,11 @@ continue; } result = true; + if (!temporary) { + current_width = width; + current_height = height; + current_freq = freq; + } break; } } @@ -368,7 +373,7 @@ printfDebug("Could not open display"); return; } - if (!setMode(disp, screen, current_width, current_height, current_freq)) + if (!setMode(disp, screen, current_width, current_height, current_freq, false)) printfDebug("Could not restore mode\n"); setCurrentGamma(disp, screen, NULL); XCloseDisplay(disp); @@ -392,20 +397,16 @@ throwException(env, "Could not open display"); return; } - if (setMode(disp, screen, width, height, freq)) { - current_width = width; - current_height = height; - current_freq = freq; - } else + if (!setMode(disp, screen, width, height, freq, false)) throwException(env, "Could not switch mode."); XCloseDisplay(disp); } -void resetDisplayMode(int screen) { +void resetDisplayMode(int screen, bool temporary) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) return; - if (!setMode(disp, screen, saved_width, saved_height, saved_freq)) { + if (!setMode(disp, screen, saved_width, saved_height, saved_freq, temporary)) { printfDebug("Failed to reset mode"); } if (saved_gamma_ramp_length > 0) { Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_opengl_Display.c 22 Sep 2004 19:25:16 -0000 1.5 +++ org_lwjgl_opengl_Display.c 22 Sep 2004 19:56:02 -0000 1.6 @@ -207,7 +207,7 @@ updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(getCurrentScreen()); + resetDisplayMode(getCurrentScreen(), true); } return true; } @@ -664,7 +664,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_resetDisplayMode(JNIEnv *env, jclass clazz) { - resetDisplayMode(getCurrentScreen()); + resetDisplayMode(getCurrentScreen(), false); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Display_getGammaRampLength(JNIEnv *env, jclass clazz) { |
|
From: Elias N. <eli...@us...> - 2004-09-22 19:25:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13079/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: reset/restore gamma settings on activate/deactivate Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- display.h 8 Sep 2004 20:15:55 -0000 1.4 +++ display.h 22 Sep 2004 19:25:16 -0000 1.5 @@ -50,12 +50,11 @@ extern int getScreenModeHeight(void); extern jobject initDisplay(JNIEnv *env, int screen); extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen); -extern void resetDisplayMode(JNIEnv * env, int screen); +extern void resetDisplayMode(int screen); extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen); extern int getGammaRampLength(int screen); extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); extern extension getCurrentDisplayModeExtension(); -extern void temporaryResetMode(int screen); extern void temporaryRestoreMode(int screen); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- display.c 10 Sep 2004 08:13:55 -0000 1.1 +++ display.c 22 Sep 2004 19:25:15 -0000 1.2 @@ -68,9 +68,11 @@ static int current_height; static int current_freq; static int saved_gamma_ramp_length = 0; -static unsigned short *r_ramp; -static unsigned short *g_ramp; -static unsigned short *b_ramp; +static unsigned short *r_ramp = NULL; +static unsigned short *g_ramp = NULL; +static unsigned short *b_ramp = NULL; +static unsigned short *current_ramp = NULL; +static int current_gamma_ramp_length = 0; static extension current_extension = NONE; int getScreenModeWidth(void) { @@ -341,26 +343,34 @@ return newMode; } -void temporaryRestoreMode(int screen) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - printfDebug("Could not open display"); +static void freeCurrentGamma(void) { + if (current_ramp != NULL) { + free(current_ramp); + current_ramp = NULL; + current_gamma_ramp_length = 0; + } +} + +static void setCurrentGamma(Display *disp, int screen, JNIEnv *env) { + if (current_gamma_ramp_length == 0) return; + if (XF86VidModeSetGammaRamp(disp, screen, current_gamma_ramp_length, current_ramp, current_ramp, current_ramp) == False) { + if (env != NULL) + throwException(env, "Could not set gamma ramp."); + else + printfDebug("Could not set gamma ramp\n"); } - if (!setMode(disp, screen, current_width, current_height, current_freq)) - printfDebug("Could not restore mode\n"); - XCloseDisplay(disp); - // Don't propagate error to caller } -void temporaryResetMode(int screen) { +void temporaryRestoreMode(int screen) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebug("Could not open display"); return; } - if (!setMode(disp, screen, saved_width, saved_height, saved_freq)) - printfDebug("Could not reset mode\n"); + if (!setMode(disp, screen, current_width, current_height, current_freq)) + printfDebug("Could not restore mode\n"); + setCurrentGamma(disp, screen, NULL); XCloseDisplay(disp); // Don't propagate error to caller } @@ -391,9 +401,8 @@ XCloseDisplay(disp); } -void resetDisplayMode(JNIEnv *env, int screen) { +void resetDisplayMode(int screen) { Display *disp = XOpenDisplay(NULL); -// Display *disp = incDisplay(env); if (disp == NULL) return; if (!setMode(disp, screen, saved_width, saved_height, saved_freq)) { @@ -401,7 +410,6 @@ } if (saved_gamma_ramp_length > 0) { XF86VidModeSetGammaRamp(disp, screen, saved_gamma_ramp_length, r_ramp, g_ramp, b_ramp); - freeSavedGammaRamps(); } // decDisplay(); XCloseDisplay(disp); @@ -443,21 +451,19 @@ throwException(env, "Could not open display"); return; } - int gamma_ramp_length = getGammaRampLengthOfDisplay(disp, screen); - if (gamma_ramp_length == 0) { + freeCurrentGamma(); + current_gamma_ramp_length = getGammaRampLengthOfDisplay(disp, screen); + if (current_gamma_ramp_length == 0) { throwException(env, "Gamma ramp not supported"); return; } const float *gamma_ramp = (const float *)(*env)->GetDirectBufferAddress(env, gamma_ramp_buffer); - unsigned short *ramp; - ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); + current_ramp = (unsigned short *)malloc(sizeof(unsigned short)*current_gamma_ramp_length); int i; - for (i = 0; i < gamma_ramp_length; i++) { + for (i = 0; i < current_gamma_ramp_length; i++) { float scaled_gamma = gamma_ramp[i]*0xffff; - ramp[i] = (unsigned short)round(scaled_gamma); - } - if (XF86VidModeSetGammaRamp(disp, screen, gamma_ramp_length, ramp, ramp, ramp) == False) { - throwException(env, "Could not set gamma ramp."); + current_ramp[i] = (unsigned short)round(scaled_gamma); } + setCurrentGamma(disp, screen, env); XCloseDisplay(disp); } Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_Display.c 22 Sep 2004 09:28:09 -0000 1.4 +++ org_lwjgl_opengl_Display.c 22 Sep 2004 19:25:16 -0000 1.5 @@ -207,7 +207,7 @@ updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - temporaryResetMode(getCurrentScreen()); + resetDisplayMode(getCurrentScreen()); } return true; } @@ -664,7 +664,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_resetDisplayMode(JNIEnv *env, jclass clazz) { - resetDisplayMode(env, getCurrentScreen()); + resetDisplayMode(getCurrentScreen()); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Display_getGammaRampLength(JNIEnv *env, jclass clazz) { |
|
From: Elias N. <eli...@us...> - 2004-09-22 19:25:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13079/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Linux: reset/restore gamma settings on activate/deactivate Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Display.java 15 Sep 2004 17:07:04 -0000 1.23 +++ Display.java 22 Sep 2004 19:25:15 -0000 1.24 @@ -370,9 +370,9 @@ try { if (fullscreen) { switchDisplayMode(); - } else { + } else { resetDisplayMode(); - } + } createWindow(); } catch (LWJGLException e) { destroyContext(); |
|
From: Elias N. <eli...@us...> - 2004-09-22 18:42:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4253/test Modified Files: DisplayTest.java Log Message: Fix DisplayTest Index: DisplayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/DisplayTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- DisplayTest.java 22 Jul 2004 15:10:55 -0000 1.5 +++ DisplayTest.java 22 Sep 2004 18:42:16 -0000 1.6 @@ -124,12 +124,10 @@ } // find a mode - System.out.print("Looking for 640x480x16@60..."); + System.out.print("Looking for 640x480..."); for(int i=0; i<modes.length;i++) { if (modes[i].getWidth() == 640 && - modes[i].getHeight() == 480 && - modes[i].getBitsPerPixel() == 16 && - modes[i].getFrequency() == 60) { + modes[i].getHeight() == 480) { mode = modes[i]; System.out.println("found!"); break; |
|
From: Elias N. <eli...@us...> - 2004-09-22 18:35:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2666 Modified Files: org_lwjgl_input_Mouse.c Log Message: Fix linux Mouse compile Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_input_Mouse.c 22 Sep 2004 17:54:26 -0000 1.11 +++ org_lwjgl_input_Mouse.c 22 Sep 2004 18:35:14 -0000 1.12 @@ -302,7 +302,7 @@ default: break; } - dz += delta; + accum_dz += delta; handleButton(event, 1); } |
|
From: Elias N. <eli...@us...> - 2004-09-22 18:21:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32376/src/native/common Modified Files: org_lwjgl_input_Keyboard.h org_lwjgl_input_Mouse.h Log Message: Win32: reset/restore display mode when activated/deactivated Index: org_lwjgl_input_Mouse.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_input_Mouse.h 25 Jul 2004 14:28:50 -0000 1.17 +++ org_lwjgl_input_Mouse.h 22 Sep 2004 18:21:28 -0000 1.18 @@ -39,8 +39,13 @@ /* Inaccessible static: readBuffer */ /* Inaccessible static: eventButton */ /* Inaccessible static: eventState */ +/* Inaccessible static: event_dx */ +/* Inaccessible static: event_dy */ +/* Inaccessible static: event_dwheel */ #undef org_lwjgl_input_Mouse_BUFFER_SIZE #define org_lwjgl_input_Mouse_BUFFER_SIZE 50L +#undef org_lwjgl_input_Mouse_EVENT_SIZE +#define org_lwjgl_input_Mouse_EVENT_SIZE 5L /* Inaccessible static: isGrabbed */ /* Inaccessible static: trackingEnabled */ /* @@ -126,7 +131,7 @@ /* * Class: org_lwjgl_input_Mouse * Method: nRead - * Signature: (Ljava/nio/ByteBuffer;I)I + * Signature: (Ljava/nio/IntBuffer;I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nRead (JNIEnv *, jclass, jobject, jint); Index: org_lwjgl_input_Keyboard.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Keyboard.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_input_Keyboard.h 7 Apr 2004 07:48:35 -0000 1.11 +++ org_lwjgl_input_Keyboard.h 22 Sep 2004 18:21:28 -0000 1.12 @@ -265,6 +265,8 @@ #define org_lwjgl_input_Keyboard_STATE_UNKNOWN 2L #undef org_lwjgl_input_Keyboard_BUFFER_SIZE #define org_lwjgl_input_Keyboard_BUFFER_SIZE 50L +#undef org_lwjgl_input_Keyboard_EVENT_SIZE +#define org_lwjgl_input_Keyboard_EVENT_SIZE 3L /* Inaccessible static: keyName */ /* Inaccessible static: keyMap */ /* Inaccessible static: counter */ @@ -305,7 +307,7 @@ /* * Class: org_lwjgl_input_Keyboard * Method: nRead - * Signature: (Ljava/nio/ByteBuffer;I)I + * Signature: (Ljava/nio/IntBuffer;I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead (JNIEnv *, jclass, jobject, jint); |
|
From: Elias N. <eli...@us...> - 2004-09-22 18:21:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32376/src/native/win32 Modified Files: display.cpp display.h org_lwjgl_opengl_Display.cpp Log Message: Win32: reset/restore display mode when activated/deactivated Index: display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/display.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- display.cpp 15 Sep 2004 17:07:06 -0000 1.4 +++ display.cpp 22 Sep 2004 18:21:28 -0000 1.5 @@ -232,48 +232,6 @@ modeSet = true; } -/* - * Temporarily reset display settings. This is called when the window is minimized. - */ -/*static void tempResetDisplayMode() { - // Return device gamma to normal - HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, originalGamma)) { - printfDebug("Could not reset device gamma\n"); - } - ReleaseDC(NULL, screenDC); - - if (modeSet) { - printfDebug("Attempting to temporarily reset the display mode\n"); - modeSet = false; - // Under Win32, all we have to do is: - ChangeDisplaySettings(NULL, 0); - } -} -*/ -/* - * Put display settings back to what they were when the window is maximized. - */ -/*static void tempRestoreDisplayMode() { - // Restore gamma - HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, currentGamma)) { - printfDebug("Could not restore device gamma\n"); - } - ReleaseDC(NULL, screenDC); - - if (!modeSet) { - printfDebug("Attempting to restore the display mode\n"); - modeSet = true; - LONG cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN); - - if (cdsret != DISP_CHANGE_SUCCESSFUL) { - printfDebug("Failed to restore display mode\n"); - } - } -} -*/ - int getGammaRampLength(void) { return 256; @@ -328,9 +286,7 @@ return newMode; } -void resetDisplayMode(JNIEnv * env) -{ - +void resetDisplayMode(JNIEnv * env) { // Return device gamma to normal HDC screenDC = GetDC(NULL); if (!SetDeviceGammaRamp(screenDC, originalGamma)) { @@ -344,7 +300,30 @@ ChangeDisplaySettings(NULL, 0); // And we'll call init() again to put the correct mode back in Display - initDisplay(env); + if (env != NULL) + initDisplay(env); + } +} + +/* + * Put display settings back to what they were when the window is maximized. + */ +void restoreDisplayMode(void) { + // Restore gamma + HDC screenDC = GetDC(NULL); + if (!SetDeviceGammaRamp(screenDC, currentGamma)) { + printfDebug("Could not restore device gamma\n"); + } + ReleaseDC(NULL, screenDC); + + if (!modeSet) { + printfDebug("Attempting to restore the display mode\n"); + modeSet = true; + LONG cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN); + + if (cdsret != DISP_CHANGE_SUCCESSFUL) { + printfDebug("Failed to restore display mode\n"); + } } } Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/display.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- display.h 3 Jul 2004 14:41:06 -0000 1.2 +++ display.h 22 Sep 2004 18:21:28 -0000 1.3 @@ -47,6 +47,7 @@ extern jobjectArray getAvailableDisplayModes(JNIEnv *env); extern void switchDisplayMode(JNIEnv * env, jobject mode); extern void resetDisplayMode(JNIEnv * env); +extern void restoreDisplayMode(void); extern int getGammaRampLength(void); extern void setGammaRamp(JNIEnv * env, jobject gammaRampBuffer); extern jobject initDisplay(JNIEnv * env); Index: org_lwjgl_opengl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- org_lwjgl_opengl_Display.cpp 22 Sep 2004 15:06:27 -0000 1.25 +++ org_lwjgl_opengl_Display.cpp 22 Sep 2004 18:21:28 -0000 1.26 @@ -284,10 +284,13 @@ static void appActivate(bool active) { if (active) { + if (isFullScreen) + restoreDisplayMode(); SetForegroundWindow(display_hwnd); ShowWindow(display_hwnd, SW_RESTORE); } else if (isFullScreen) { ShowWindow(display_hwnd, SW_MINIMIZE); + resetDisplayMode(NULL); } } |
|
From: Elias N. <eli...@us...> - 2004-09-22 18:03:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28826/src/java/org/lwjgl/test/input Modified Files: HWCursorTest.java MouseTest.java Log Message: Fix Mouse tests Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- HWCursorTest.java 22 Jul 2004 14:56:39 -0000 1.36 +++ HWCursorTest.java 22 Sep 2004 18:03:10 -0000 1.37 @@ -279,7 +279,8 @@ mouse_y = Mouse.getY(); while(Mouse.next()) { - if(Mouse.getEventButtonState() && Mouse.getEventButton() < 3) { + int button = Mouse.getEventButton(); + if(button >= 0 && button < 3 && Mouse.getEventButtonState()) { mouse_btn = Mouse.getEventButton(); } } Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- MouseTest.java 17 Sep 2004 05:56:10 -0000 1.40 +++ MouseTest.java 22 Sep 2004 18:03:10 -0000 1.41 @@ -240,7 +240,7 @@ private void readBufferedMouse() { // iterate all events, use the last button down while(Mouse.next()) { - if(Mouse.getEventButtonState()) { + if(Mouse.getEventButton() != -1 && Mouse.getEventButtonState()) { lastButton = Mouse.getEventButton(); } } |