Nux

Merge lp:~unity-team/nux/nux-getmeshbuffer into lp:nux/2.0

Proposed by Jay Taoko
Status: Merged
Approved by: Jay Taoko
Approved revision: 553
Merged at revision: 553
Proposed branch: lp:~unity-team/nux/nux-getmeshbuffer
Merge into: lp:nux/2.0
Diff against target: 831 lines (+92/-400)
8 files modified
Nux/WindowCompositor.cpp (+8/-0)
NuxGraphics/Events.cpp (+25/-3)
NuxGraphics/Events.h (+5/-0)
NuxGraphics/GLVertexResourceManager.cpp (+34/-324)
NuxGraphics/GLVertexResourceManager.h (+8/-64)
NuxGraphics/GraphicsDisplayWin.cpp (+8/-8)
NuxImage/ImageSurface.h (+3/-0)
configure.ac (+1/-1)
To merge this branch: bzr merge lp:~unity-team/nux/nux-getmeshbuffer
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Tim Penhey (community) Needs Information
Review via email: mp+89575@code.launchpad.net

Description of the change

* Code style fixes
* Added win32_keycode and win32_keysym in Event class for Windows
* Added GetCachedMeshBuffer in MeshBuffer class

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Just to confirm, we know this works by continuting to compile on both windows and linux and continues to render the test cases?

review: Needs Information
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Yes, tests have been run with this branch and unity as well.

Revision history for this message
Jay Taoko (jaytaoko) wrote :

Note: Review and approve the code only, do not initiate the merge into trunk.

Revision history for this message
Jason Smith (jassmith) wrote :

+1 approve
love seeing all that dead code go.

review: Approve
lp:~unity-team/nux/nux-getmeshbuffer updated
552. By Jason Smith

UNBLOCK

Fixes severe slowness when laying lots of these bad boys out. Fixes: . Approved by Gord Allott, Jay Taoko.

553. By Jay Taoko

Merged with Nux trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/WindowCompositor.cpp'
2--- Nux/WindowCompositor.cpp 2012-01-30 08:33:47 +0000
3+++ Nux/WindowCompositor.cpp 2012-02-03 23:06:21 +0000
4@@ -961,7 +961,11 @@
5 SendKeyEvent(key_focus_area_,
6 event.type,
7 event.GetKeySym(),
8+#if defined(NUX_OS_WINDOWS)
9+ event.win32_keycode,
10+#elif defined(NUX_OS_LINUX)
11 event.x11_keycode,
12+#endif
13 event.GetKeyState(),
14 event.GetText(),
15 event.GetKeyRepeatCount());
16@@ -980,7 +984,11 @@
17 SendKeyEvent(static_cast<InputArea*>(parent),
18 event.type,
19 event.GetKeySym(),
20+#if defined(NUX_OS_WINDOWS)
21+ event.win32_keycode,
22+#elif defined(NUX_OS_LINUX)
23 event.x11_keycode,
24+#endif
25 event.GetKeyState(),
26 event.GetText(),
27 event.GetKeyRepeatCount());
28
29=== modified file 'NuxGraphics/Events.cpp'
30--- NuxGraphics/Events.cpp 2012-01-27 07:25:16 +0000
31+++ NuxGraphics/Events.cpp 2012-02-03 23:06:21 +0000
32@@ -50,7 +50,7 @@
33 else if (button == NUX_MOUSE_BUTTON4)
34 return(button_state & NUX_STATE_BUTTON4_DOWN) ? true : false;
35
36- return false;
37+ return false;
38 }
39
40 bool GetKeyModifierState(unsigned long key_modifiers_states, KeyModifier key_modifier)
41@@ -80,9 +80,13 @@
42 dy = 0;
43 clicks = 0;
44 is_click = 0;
45-
46 wheel_delta = 0;
47-
48+
49+#if defined(NUX_OS_WINDOWS)
50+ win32_keycode = 0;
51+ win32_keysym = 0;
52+#endif
53+
54 #if defined(NUX_OS_LINUX)
55 x11_keycode = 0;
56 x11_keysym = 0;
57@@ -98,7 +102,17 @@
58 {
59 type = NUX_NO_EVENT;
60 Memset(text, 0, sizeof(text));
61+#if defined(NUX_OS_WINDOWS)
62+ win32_keycode = 0;
63+ win32_keysym = 0;
64+#endif
65+
66+#if defined(NUX_OS_LINUX)
67+ x11_keycode = 0;
68 x11_keysym = 0;
69+ x11_key_state = 0;
70+#endif
71+
72 key_repeat_count = 0;
73 key_modifiers = 0;
74 wheel_delta = 0;
75@@ -179,7 +193,15 @@
76 */
77 unsigned long Event::GetKeySym() const
78 {
79+#if defined(NUX_OS_WINDOWS)
80+ return win32_keysym;
81+#endif
82+
83+#if defined(NUX_OS_LINUX)
84 return x11_keysym;
85+#endif
86+
87+ return 0;
88 }
89 unsigned short Event::GetKeyRepeatCount() const
90 {
91
92=== modified file 'NuxGraphics/Events.h'
93--- NuxGraphics/Events.h 2012-01-27 07:25:16 +0000
94+++ NuxGraphics/Events.h 2012-02-03 23:06:21 +0000
95@@ -386,6 +386,11 @@
96 int clicks;
97 int is_click;
98
99+#if defined(NUX_OS_WINDOWS)
100+ int win32_keycode; // Not used. Just a place holder.
101+ int win32_keysym;
102+#endif
103+
104 #if defined(NUX_OS_LINUX)
105 Time x11_timestamp; //!< X11 timestamp.
106 Window x11_window; //!< X11 window.
107
108=== modified file 'NuxGraphics/GLVertexResourceManager.cpp'
109--- NuxGraphics/GLVertexResourceManager.cpp 2011-10-19 20:32:38 +0000
110+++ NuxGraphics/GLVertexResourceManager.cpp 2012-02-03 23:06:21 +0000
111@@ -55,14 +55,14 @@
112 }
113
114 //! Copy constructor
115- VertexBuffer::VertexBuffer(const VertexBuffer &Other)
116+ VertexBuffer::VertexBuffer(const VertexBuffer& Other)
117 {
118 _Data = Other._Data;
119 _Stride = Other._Stride;
120 }
121
122 //! Assignment constructor
123- VertexBuffer &VertexBuffer::operator = (const VertexBuffer &Other)
124+ VertexBuffer& VertexBuffer::operator = (const VertexBuffer& Other)
125 {
126 _Data = Other._Data;
127 _Stride = Other._Stride;
128@@ -117,7 +117,7 @@
129 if (_Data.size() == 0)
130 return 0;
131
132- return NUX_CONST_CAST(void*, ((NUX_CONST_CAST(const VertexBuffer *, this))->GetPtrRawData()));
133+ return NUX_CONST_CAST(void*, ((NUX_CONST_CAST(const VertexBuffer*, this))->GetPtrRawData()));
134 }
135
136 IndexBuffer::IndexBuffer()
137@@ -136,14 +136,14 @@
138 }
139
140 //! Copy constructor
141- IndexBuffer::IndexBuffer(const IndexBuffer &Other)
142+ IndexBuffer::IndexBuffer(const IndexBuffer& Other)
143 {
144 _Data = Other._Data;
145 _Stride = Other._Stride;
146 }
147
148 //! Assignment constructor
149- IndexBuffer &IndexBuffer::operator = (const IndexBuffer &Other)
150+ IndexBuffer& IndexBuffer::operator = (const IndexBuffer& Other)
151 {
152 _Data = Other._Data;
153 _Stride = Other._Stride;
154@@ -194,7 +194,7 @@
155
156 void* IndexBuffer::GetPtrRawData()
157 {
158- return NUX_CONST_CAST(void*, ((NUX_CONST_CAST(const IndexBuffer *, this))->GetPtrRawData()));
159+ return NUX_CONST_CAST(void*, ((NUX_CONST_CAST(const IndexBuffer*, this))->GetPtrRawData()));
160 }
161
162 VertexDeclaration::VertexDeclaration()
163@@ -212,63 +212,10 @@
164 _declaration.push_back(Component);
165 }
166
167-
168-// NMeshComponent::NMeshComponent()
169-// : _Type(ATTRIB_DECLTYPE_UNKNOWN)
170-// , _StreamIndex(-1)
171-// , _Offset(0)
172-// {
173-// }
174-//
175-// NMeshComponent::NMeshComponent(const NMeshComponent &Other)
176-// : _Type(ATTRIB_DECLTYPE_UNKNOWN)
177-// , _StreamIndex(-1)
178-// , _Offset(0)
179-// {
180-// _Type = Other._Type;
181-// _Offset = Other._Offset;
182-// _StreamIndex = Other._StreamIndex;
183-// }
184-//
185-// NMeshComponent::NMeshComponent(int StreamIndex/*ObjectPtr<VertexBuffer> VtxBuffer*/, int Offset, ATTRIB_DECL_TYPE Type)
186-// {
187-// nuxAssert(Offset >= 0);
188-// _Type = Type;
189-// _Offset = Offset;
190-// _StreamIndex = StreamIndex;
191-// }
192-//
193-// NMeshComponent::~NMeshComponent()
194-// {
195-// }
196-//
197-// NMeshComponent &NMeshComponent::operator = (const NMeshComponent &Other)
198-// {
199-// _Type = Other._Type;
200-// _Offset = Other._Offset;
201-// _StreamIndex = Other._StreamIndex;
202-// return *this;
203-// }
204-//
205-// int NMeshComponent::GetStreamIndex() const
206-// {
207-// return _StreamIndex;
208-// }
209-//
210-// // int NMeshComponent::GetStride()
211-// // {
212-// // return _VtxBuffer->GetStride();
213-// // }
214-//
215-// int NMeshComponent::GetOffset()
216-// {
217-// return _Offset;
218-// }
219-
220- CachedVertexBuffer::CachedVertexBuffer(NResourceSet *ResourceManager, VertexBuffer *SourceVtxBuffer)
221- : CachedResourceData(ResourceManager)
222- , _Size(0)
223- , _Stride(0)
224+ CachedVertexBuffer::CachedVertexBuffer(NResourceSet* ResourceManager, VertexBuffer* SourceVtxBuffer)
225+ : CachedResourceData(ResourceManager)
226+ , _Size(0)
227+ , _Stride(0)
228 {
229 UpdateResource(SourceVtxBuffer);
230 }
231@@ -279,7 +226,7 @@
232 _vertex_buffer = ObjectPtr<IOpenGLVertexBuffer> (0);
233 }
234
235- bool CachedVertexBuffer::UpdateResource(ResourceData *Source)
236+ bool CachedVertexBuffer::UpdateResource(ResourceData* Source)
237 {
238 if (Source == 0)
239 {
240@@ -288,12 +235,12 @@
241 return true;
242 }
243
244- VertexBuffer *SourceVtxBuffer = 0;
245+ VertexBuffer* SourceVtxBuffer = 0;
246 nuxAssert(Source->Type().IsDerivedFromType(VertexBuffer::StaticObjectType));
247
248 if (Source->Type().IsDerivedFromType(VertexBuffer::StaticObjectType))
249 {
250- SourceVtxBuffer = NUX_STATIC_CAST(VertexBuffer *, Source);
251+ SourceVtxBuffer = NUX_STATIC_CAST(VertexBuffer* , Source);
252 }
253 else
254 {
255@@ -329,16 +276,16 @@
256 return true;
257 }
258
259- void CachedVertexBuffer::LoadVertexData(VertexBuffer *SourceVtxBuffer)
260+ void CachedVertexBuffer::LoadVertexData(VertexBuffer* SourceVtxBuffer)
261 {
262 if ((SourceVtxBuffer == 0) || (SourceVtxBuffer->GetSize() == 0) || (SourceVtxBuffer->GetStride() == 0))
263 {
264 return;
265 }
266
267- t_byte *pData;
268+ t_byte* pData;
269
270- _vertex_buffer->Lock(0, 0, (void **) &pData);
271+ _vertex_buffer->Lock(0, 0, (void**) &pData);
272 Memcpy(pData, SourceVtxBuffer->GetPtrRawData(), SourceVtxBuffer->GetSize());
273 _vertex_buffer->Unlock();
274 }
275@@ -353,7 +300,7 @@
276 return _Stride;
277 }
278
279- CachedIndexBuffer::CachedIndexBuffer(NResourceSet *ResourceManager, IndexBuffer *SourceIdxBuffer)
280+ CachedIndexBuffer::CachedIndexBuffer(NResourceSet* ResourceManager, IndexBuffer* SourceIdxBuffer)
281 : CachedResourceData(ResourceManager)
282 , _Size(0)
283 , _Stride(0)
284@@ -367,7 +314,7 @@
285 _index_buffer = ObjectPtr<IOpenGLIndexBuffer> (0);
286 }
287
288- bool CachedIndexBuffer::UpdateResource(ResourceData *Source)
289+ bool CachedIndexBuffer::UpdateResource(ResourceData* Source)
290 {
291 if (Source == 0)
292 {
293@@ -377,12 +324,12 @@
294 return true;
295 }
296
297- IndexBuffer *SourceIdxBuffer = 0;
298+ IndexBuffer* SourceIdxBuffer = 0;
299 nuxAssert(Source->Type().IsDerivedFromType(IndexBuffer::StaticObjectType));
300
301 if (Source->Type().IsDerivedFromType(IndexBuffer::StaticObjectType))
302 {
303- SourceIdxBuffer = NUX_STATIC_CAST(IndexBuffer *, Source);
304+ SourceIdxBuffer = NUX_STATIC_CAST(IndexBuffer*, Source);
305 }
306 else
307 {
308@@ -419,15 +366,15 @@
309 return true;
310 }
311
312- void CachedIndexBuffer::LoadIndexData(IndexBuffer *SourceIdxBuffer)
313+ void CachedIndexBuffer::LoadIndexData(IndexBuffer* SourceIdxBuffer)
314 {
315 if ((SourceIdxBuffer == 0) || (SourceIdxBuffer->GetSize() == 0) || (SourceIdxBuffer->GetStride() == 0))
316 {
317 return;
318 }
319
320- t_byte *pData;
321- _index_buffer->Lock(0, 0, (void **) &pData);
322+ t_byte* pData;
323+ _index_buffer->Lock(0, 0, (void**) &pData);
324 Memcpy(pData, SourceIdxBuffer->GetPtrRawData(), SourceIdxBuffer->GetSize());
325 _index_buffer->Unlock();
326 }
327@@ -447,7 +394,7 @@
328 return _num_index;
329 }
330
331- CachedVertexDeclaration::CachedVertexDeclaration(NResourceSet *ResourceManager, VertexDeclaration *SourceVertexDeclaration)
332+ CachedVertexDeclaration::CachedVertexDeclaration(NResourceSet* ResourceManager, VertexDeclaration* SourceVertexDeclaration)
333 : CachedResourceData(ResourceManager)
334 {
335 UpdateResource(SourceVertexDeclaration);
336@@ -458,7 +405,7 @@
337 _declaration = ObjectPtr<IOpenGLVertexDeclaration> (0);
338 }
339
340- bool CachedVertexDeclaration::UpdateResource(ResourceData *Source)
341+ bool CachedVertexDeclaration::UpdateResource(ResourceData* Source)
342 {
343 if (Source == 0)
344 {
345@@ -466,12 +413,12 @@
346 return true;
347 }
348
349- VertexDeclaration *SourceVertexDeclaration = 0;
350+ VertexDeclaration* SourceVertexDeclaration = 0;
351 nuxAssert(Source->Type().IsDerivedFromType(VertexDeclaration::StaticObjectType));
352
353 if (Source->Type().IsDerivedFromType(VertexDeclaration::StaticObjectType))
354 {
355- SourceVertexDeclaration = NUX_STATIC_CAST(VertexDeclaration *, Source);
356+ SourceVertexDeclaration = NUX_STATIC_CAST(VertexDeclaration*, Source);
357 }
358 else
359 {
360@@ -489,6 +436,7 @@
361 }
362
363 MeshBuffer::MeshBuffer(NUX_FILE_LINE_DECL)
364+ : ResourceData(NUX_FILE_LINE_PARAM)
365 {
366 _vertex_buffer = 0;
367 _index_buffer = 0;
368@@ -539,6 +487,11 @@
369 return true;
370 }
371
372+ ObjectPtr<CachedMeshBuffer> MeshBuffer::GetCachedMeshBuffer()
373+ {
374+ return GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(this);
375+ }
376+
377 CachedMeshBuffer::CachedMeshBuffer(NResourceSet* ResourceManager, MeshBuffer* resource)
378 : CachedResourceData(ResourceManager)
379 {
380@@ -563,251 +516,8 @@
381 _cached_vertex_declaration->_declaration->SetVertexBuffer(2, _cached_vertex_buffer->_vertex_buffer);
382
383 _mesh_primitive_type = mesh_buffer->_mesh_primitive_type;
384-//
385+
386 return true;
387 }
388-
389-
390-// NMesh::NMesh()
391-// {
392-//
393-// }
394-//
395-// NMesh::~NMesh()
396-// {
397-//
398-// }
399-//
400-//
401-// NStaticMesh::NStaticMesh(NMeshObject *Object)
402-// {
403-// if (Object == 0)
404-// return;
405-// }
406-//
407-// NStaticMesh::~NStaticMesh()
408-// {
409-// delete m_pVertexDeclaration;
410-// delete m_pIndex;
411-//
412-// for (int i = 0; i < (int) m_pVertexStreamArray.size(); i++)
413-// {
414-// delete m_pVertexStreamArray[i];
415-// }
416-// }
417-//
418-// int NStaticMesh::GetNumStreams() const
419-// {
420-// return(int) m_pVertexStreamArray.size();
421-// }
422-//
423-// NGLStaticMesh::NGLStaticMesh(NResourceSet *ResourceManager, NStaticMesh *StaticMesh)
424-// : CachedResourceData(ResourceManager)
425-// {
426-// int NumStreams = StaticMesh->GetNumStreams();
427-//
428-// for (int s = 0; s < NumStreams; s++)
429-// {
430-// m_VertexBufferArray.push_back(GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(StaticMesh->m_pVertexStreamArray[s]));
431-// }
432-//
433-// m_Index = ObjectPtr<CachedIndexBuffer> (GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(StaticMesh->m_pIndex));
434-// m_VertexDeclaration = ObjectPtr<CachedVertexDeclaration> (GetGraphicsDisplay()->GetGraphicsEngine()->CacheResource(StaticMesh->m_pVertexDeclaration));
435-// }
436-//
437-// NGLStaticMesh::~NGLStaticMesh()
438-// {
439-//
440-// }
441-//
442-// bool NGLStaticMesh::UpdateResource(ResourceData *Source)
443-// {
444-// if (Source == 0)
445-// {
446-// int NumStreams = m_VertexBufferArray.size();
447-//
448-// for (int s = 0; s < NumStreams; s++)
449-// {
450-// m_VertexBufferArray[s]->UpdateResource(0);
451-// }
452-//
453-// m_Index->UpdateResource(0);
454-// m_VertexDeclaration->UpdateResource(0);
455-// return true;
456-// }
457-//
458-// NStaticMesh *StaticMesh = 0;
459-// nuxAssert(Source->Type().IsDerivedFromType(NStaticMesh::StaticObjectType));
460-//
461-// if (Source->Type().IsDerivedFromType(NStaticMesh::StaticObjectType))
462-// {
463-// StaticMesh = NUX_STATIC_CAST(NStaticMesh *, Source);
464-// }
465-// else
466-// {
467-// return false;
468-// }
469-//
470-// int NumStreams = StaticMesh->GetNumStreams();
471-//
472-// for (int s = 0; s < NumStreams; s++)
473-// {
474-// GetGraphicsDisplay()->GetGraphicsEngine()->UpdateResource(StaticMesh->m_pVertexStreamArray[s]);
475-// }
476-//
477-// GetGraphicsDisplay()->GetGraphicsEngine()->UpdateResource(StaticMesh->m_pIndex);
478-// GetGraphicsDisplay()->GetGraphicsEngine()->UpdateResource(StaticMesh->m_pVertexDeclaration);
479-// return true;
480-// }
481-
482-
483-// static void sWriteFloat(float** Ptr, float a, float b, float c, float d)
484-// {
485-// *Ptr[0] = a; *Ptr[1] = b; *Ptr[2] = c; *Ptr[3] = d;
486-// *Ptr += 4;
487-// }
488-
489-// NStaticMesh::NStaticMesh()
490-// {
491-//
492-// }
493-//
494-//
495-// NCubeVertexBuffer::NCubeVertexBuffer()
496-// {
497-// VERTEXELEMENT decl [] =
498-// {
499-// {0/*Stream*/, 0/*Offset*/, ATTRIB_CT_FLOAT/*Type*/, 4/*NumComponent*/, ATTRIB_USAGE_DECL_POSITION/*Usage*/, 0/*UsageIndex*/, 0 /*CgParameter*/},
500-// DECL_END
501-// };
502-// INT i = 0;
503-// while (decl[i].Stream != 0xFF)
504-// {
505-// _DeclarationsArray.push_back(decl[i]);
506-// i++;
507-// }
508-//
509-//
510-// // 4+------+7
511-// // /| /|
512-// // / | / | y
513-// // / 5+---/--+6 |
514-// // 0+------+3 / |
515-// // | / | / *---x
516-// // |/ |/ /
517-// // 1+------+2 /
518-// // z
519-//
520-// float width_ = 1.0f;
521-// float height_ = 1.0f;
522-// float depth_ = 1.0f;
523-// float w_ = 1.0f;
524-//
525-// Vector4 v0, v1, v2;
526-// // Front
527-// v0 = Vector4(-width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 0
528-// v1 = Vector4(-width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 1
529-// v2 = Vector4(width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 2
530-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
531-//
532-// v0 = Vector4(-width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 0
533-// v1 = Vector4(width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 2
534-// v2 = Vector4(width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 3
535-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
536-//
537-// // Back
538-// v0 = Vector4(width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 7
539-// v1 = Vector4(width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 6
540-// v2 = Vector4(-width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 5
541-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
542-//
543-// v0 = Vector4(width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 7
544-// v1 = Vector4(-width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 5
545-// v2 = Vector4(-width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 4
546-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
547-//
548-// // Top
549-// v0 = Vector4(-width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 4
550-// v1 = Vector4(-width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 0
551-// v2 = Vector4(width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 3
552-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
553-//
554-// v0 = Vector4(-width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 4
555-// v1 = Vector4(width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 3
556-// v2 = Vector4(width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 7
557-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
558-//
559-// // Bottom
560-// v0 = Vector4(width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 6
561-// v1 = Vector4(width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 2
562-// v2 = Vector4(-width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 1
563-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
564-//
565-// v0 = Vector4(width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 6
566-// v1 = Vector4(-width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 1
567-// v2 = Vector4(-width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 5
568-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
569-//
570-// // Left
571-// v0 = Vector4(-width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 4
572-// v1 = Vector4(-width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 5
573-// v2 = Vector4(-width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 1
574-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
575-//
576-// v0 = Vector4(-width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 4
577-// v1 = Vector4(-width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 1
578-// v2 = Vector4(-width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 0
579-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
580-//
581-// // Right
582-// v0 = Vector4(width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 3
583-// v1 = Vector4(width_/2.0f, -height_/2.0f, depth_/2.0f, w_); // 2
584-// v2 = Vector4(width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 6
585-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
586-//
587-// v0 = Vector4(width_/2.0f, height_/2.0f, depth_/2.0f, w_); // 3
588-// v1 = Vector4(width_/2.0f, -height_/2.0f, -depth_/2.0f, w_); // 6
589-// v2 = Vector4(width_/2.0f, height_/2.0f, -depth_/2.0f, w_); // 7
590-// m_Vertex.push_back(v0); m_Vertex.push_back(v1); m_Vertex.push_back(v2);
591-//
592-// m_Size = (INT)m_Vertex.size() * 4 * 4; // bytes
593-// m_Stride = 0;
594-// }
595-//
596-// NCubeVertexBuffer::~NCubeVertexBuffer()
597-// {
598-// }
599-//
600-// void NCubeVertexBuffer::GetData(void* Buffer)
601-// {
602-// nuxAssert(Buffer);
603-//
604-// float *Ptr = (float*)Buffer;
605-//
606-// INT i = 0;
607-// for (i = 0; i < (INT)m_Vertex.size(); i++)
608-// {
609-// *Ptr++ = m_Vertex[i].x;
610-// *Ptr++ = m_Vertex[i].y;
611-// *Ptr++ = m_Vertex[i].z;
612-// *Ptr++ = m_Vertex[i].w;
613-// }
614-// }
615-//
616-// INT NCubeVertexBuffer::GetSize()
617-// {
618-// return m_Size; // bytes
619-// }
620-//
621-// VERTEXELEMENT NCubeVertexBuffer::GetDeclaration(INT i)
622-// {
623-// if (i < (INT)_DeclarationsArray.size())
624-// {
625-// return _DeclarationsArray[i];
626-// }
627-// VERTEXELEMENT decl = DECL_END;
628-// return decl;
629-// }
630-
631 }
632
633
634=== modified file 'NuxGraphics/GLVertexResourceManager.h'
635--- NuxGraphics/GLVertexResourceManager.h 2011-10-19 20:32:38 +0000
636+++ NuxGraphics/GLVertexResourceManager.h 2012-02-03 23:06:21 +0000
637@@ -40,9 +40,9 @@
638 virtual ~VertexBuffer();
639 VertexBuffer(int Size, int Stride);
640 //! Copy constructor
641- VertexBuffer(const VertexBuffer &);
642+ VertexBuffer(const VertexBuffer&);
643 //! Assignment constructor
644- VertexBuffer &operator = (const VertexBuffer &);
645+ VertexBuffer& operator = (const VertexBuffer&);
646
647 //! Allocate space for a "num_element", each of size "size".
648 /*!
649@@ -72,9 +72,9 @@
650 virtual ~IndexBuffer();
651 IndexBuffer(int Size, int Stride);
652 //! Copy constructor
653- IndexBuffer(const IndexBuffer &);
654+ IndexBuffer(const IndexBuffer&);
655 //! Assignment constructor
656- IndexBuffer &operator = (const IndexBuffer &);
657+ IndexBuffer& operator = (const IndexBuffer&);
658
659 void Allocate(int Size, int Stride);
660 int GetSize() const;
661@@ -151,62 +151,6 @@
662 ObjectPtr<IOpenGLVertexDeclaration> _declaration;
663 };
664
665-// class NMeshComponent
666-// {
667-// public:
668-// NMeshComponent();
669-// NMeshComponent(const NMeshComponent &);
670-// NMeshComponent(int StreamIndex/*ObjectPtr<BaseMeshBuffer> VtxBuffer*/, int Offset, ATTRIB_DECL_TYPE Type);
671-//
672-// NMeshComponent &operator = (const NMeshComponent &);
673-//
674-// virtual ~NMeshComponent();
675-//
676-// int GetStreamIndex() const;
677-// // int GetStride();
678-// int GetOffset();
679-// private:
680-// ATTRIB_DECL_TYPE _Type;
681-// int _StreamIndex;
682-// int _Offset;
683-// };
684-//
685-// class NMesh: public ResourceData
686-// {
687-// NUX_DECLARE_OBJECT_TYPE(NStaticMesh, ResourceData);
688-//
689-// NMesh();
690-// virtual ~NMesh();
691-// };
692-//
693-// class NStaticMesh: public NMesh
694-// {
695-// NUX_DECLARE_OBJECT_TYPE(NStaticMesh, NMesh);
696-// public:
697-// NStaticMesh(NMeshObject *Object);
698-// ~NStaticMesh();
699-//
700-// int GetNumStreams() const;
701-//
702-// std::vector<BaseMeshBuffer*> m_pVertexStreamArray; // up to 8 stream of buffers on most GPU
703-// NIndexBuffer *m_pIndex;
704-// NVertexDeclaration *m_pVertexDeclaration;
705-// };
706-//
707-// class NGLStaticMesh: public CachedResourceData
708-// {
709-// NUX_DECLARE_OBJECT_TYPE(NGLStaticMesh, CachedResourceData);
710-// public:
711-// NGLStaticMesh(NResourceSet *ResourceManager, NStaticMesh *);
712-// ~NGLStaticMesh();
713-// bool UpdateResource(ResourceData *Resource);
714-//
715-// std::vector<ObjectPtr<CachedVertexBuffer> > m_VertexBufferArray;
716-// ObjectPtr<CachedIndexBuffer> m_Index;
717-// ObjectPtr<CachedVertexDeclaration> m_VertexDeclaration;
718-// };
719-
720-
721 class CachedMeshBuffer;
722
723 class MeshBuffer: public ResourceData
724@@ -218,12 +162,12 @@
725
726 bool Update(const MeshData* mesh_data);
727
728- //ObjectPtr <CachedMeshBuffer> GetCachedMeshBuffer();
729+ ObjectPtr<CachedMeshBuffer> GetCachedMeshBuffer();
730
731 public:
732- VertexBuffer *_vertex_buffer;
733- IndexBuffer *_index_buffer;
734- VertexDeclaration *_vertex_declaration;
735+ VertexBuffer* _vertex_buffer;
736+ IndexBuffer* _index_buffer;
737+ VertexDeclaration* _vertex_declaration;
738 NuxMeshPrimitiveType _mesh_primitive_type;
739 };
740
741
742=== modified file 'NuxGraphics/GraphicsDisplayWin.cpp'
743--- NuxGraphics/GraphicsDisplayWin.cpp 2012-01-04 00:10:39 +0000
744+++ NuxGraphics/GraphicsDisplayWin.cpp 2012-02-03 23:06:21 +0000
745@@ -1434,7 +1434,7 @@
746 {
747 event_->type = NUX_KEYDOWN;
748 event_->key_modifiers = GetModifierKeyState();
749- event_->e_keysym = wParam;
750+ event_->win32_keysym = wParam;
751
752 if ((uMsg == WM_KEYDOWN) || (uMsg == WM_SYSKEYDOWN))
753 {
754@@ -1445,11 +1445,11 @@
755 {
756 if (lParam & (1 << 24))
757 {
758- event_->e_keysym = NUX_VK_RCONTROL;
759+ event_->win32_keysym = NUX_VK_RCONTROL;
760 }
761 else
762 {
763- event_->e_keysym = NUX_VK_LCONTROL;
764+ event_->win32_keysym = NUX_VK_LCONTROL;
765 }
766 }
767
768@@ -1457,11 +1457,11 @@
769 {
770 if (lParam & (1 << 24))
771 {
772- event_->e_keysym = NUX_VK_RALT;
773+ event_->win32_keysym = NUX_VK_RALT;
774 }
775 else
776 {
777- event_->e_keysym = NUX_VK_LALT;
778+ event_->win32_keysym = NUX_VK_LALT;
779 }
780 }
781
782@@ -1469,11 +1469,11 @@
783 {
784 if (HIWORD(GetAsyncKeyState(VK_LSHIFT)))
785 {
786- event_->e_keysym = NUX_VK_LSHIFT;
787+ event_->win32_keysym = NUX_VK_LSHIFT;
788 }
789 else if (HIWORD(GetAsyncKeyState(VK_RSHIFT)))
790 {
791- event_->e_keysym = NUX_VK_RSHIFT;
792+ event_->win32_keysym = NUX_VK_RSHIFT;
793 }
794 }
795
796@@ -1485,7 +1485,7 @@
797 {
798 event_->type = NUX_KEYUP;
799 event_->key_modifiers = GetModifierKeyState();
800- event_->e_keysym = wParam;
801+ event_->win32_keysym = wParam;
802
803 if ((uMsg == WM_KEYUP) || (uMsg == WM_SYSKEYUP))
804 {
805
806=== modified file 'NuxImage/ImageSurface.h'
807--- NuxImage/ImageSurface.h 2012-01-17 00:32:06 +0000
808+++ NuxImage/ImageSurface.h 2012-02-03 23:06:21 +0000
809@@ -282,6 +282,9 @@
810 int m_NumMipmap;
811 std::vector<ImageSurface *> m_MipSurfaceArray;
812 void ClearData();
813+#if defined(NUX_OS_WINDOWS)
814+ friend NBitmapData *read_tga_file(const TCHAR *file_name);
815+#endif
816 };
817
818 class NCubemapData: public NBitmapData
819
820=== modified file 'configure.ac'
821--- configure.ac 2012-02-02 14:54:59 +0000
822+++ configure.ac 2012-02-03 23:06:21 +0000
823@@ -22,7 +22,7 @@
824 # The number format is : year/month/day
825 # e.g.: december 5th, 2011 is: 20111205
826 # To make more than one API change in a day, add a number to the date. Like 20111205.xx
827-m4_define([nux_abi_version], [20120202.01])
828+m4_define([nux_abi_version], [20120203.01])
829
830 m4_define([nux_version],
831 [nux_major_version.nux_minor_version.nux_micro_version])

Subscribers

People subscribed via source and target branches

to all changes: