• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Pet123

  • Rank
  1. 1. HTMLayout i would suggest, because its "fast, lightweight and embeddable HTML/CSS renderer and layout manager component" and "No dependencies from installed browsers on client PC" and its free. 2. windows-only 3. yes its designed to be embeddable. 4. would be better can be linked in a static library cross platform will be even better render to memory dc (or render to texture) is buggy
  2. Thanks BitMaster for your info., Seems its a known bug about recent Windows Update, hope they will get this fixed asap. Here is msdn blog link
  3. hi there 1. Why don't you just leave windows OnPint() empty since you are using a timer? like this : LRESULT OnPaint(UINT, WPARAM, LPARAM, BOOL &) { CPaintDC dc(); return 0; } 2. When you resize to shrink a WIN32 window, the system very likely wont issue a WM_PAINT message, since your DC is larger than current window size, so no re-paint is needed (the larger part will be clipped anyway) 3. Same as above, when you MOVE a window you should not received WM_PAINT either, since the window DC size is not changed. (Drag while showing content?) 4. InvalidateRect() is just enough and i dont think update window is necessary 5. custom window skin : google 'Layered Window' may help just my two cents anyway.
  4. hi everybody, i allocated a console window (AllocConsole, synced with stdio) as debug output, recently i found it will be left open when i stopped debugging, for example, there is an assert failure then i pressed 'stop' (vs2008). the wild console window cant be closed by pressing its close button nor be killed via task manager, it behaves just like the normal one unless it cant be destroyed and even worse : the computer cant be turned off like usual (i guess the system is waiting for those consoles to be terminated but it never make it). here is some background info.: 1. vs 2008 2. the console will be correctly freed with FreeConsole when exit normally Further, i am now wondering what is the debugger going to do with a interrupted program when i stop debugging? Will the debugger continue to do the final clean jobs like free memorys, consoles, stop running threads? ( the process is stopped so the threads will be terminated very likely), what's your opinion? any hints would be helpful thank you. Pet
  5. Too bad it does not work, i have tried 1000, 3000, 5000 and 10,000, the z-fighting flaw is still there, Thanks anyway, I'm going to set the far/near values for each scene one by one till i have other better choice.
  6. thanks for the reply. i agree most of the z-fighting problems are incorrectly setting the far and near value, anyway i doubt that's reason of my case this time, here is the setting : near = 1.0f; far = 300.0f; z-fighting occurs where near the far end of the view frustum, and when i change the near value to, 5.0f for example, the z-fighting gone, so I still believe it's the problem of the depth buffer precision. the only solution for now i can come up with is to set the near and far values scene by scene, (near = 5.0f is okay for one scene, and bad for other scene : you will see a clipped near end). what's your opinion? thanks.
  7. hello everybody, My outdoor scene is fine when running on PC, anyway it will be suffering from z-fighting, i checked over and over again and i am sure i'm using a 24bits depth buffer, but why this buffer perform so poor on iphone? anybody eles have same problem? is it a real 24bits depth buffer? thank you. here are the parameters to create buffers : pixelFormat = GL_RGBA8_OES depthFormat = GL_DEPTH_COMPONENT24_OES
  8. fade out

    Thank you AndyEsser, that's exactly what i want, thank you.
  9. thanks for all the replys. you are right, jrk, the touch object (created when touchBegin and died when touchEnd) is always there, so its possible to use the touch object's address (as ID) to dispatch events. thanks.
  10. fade out

    hi there i want the dead bodys in my scene to fade out, the vertex format is <position, textureCoord> (no shader), in directx with the fixed pipeline, i can change the texture factor to achieve the alpha blending fade out effect like this // color operation device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); // alpha operation, change the 'clrCurrent' to do the fade out effect device->SetRenderState(D3DRS_TEXTUREFACTOR, clrCurrent); device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR); I'm wondering what's the D3DRS_TEXTUREFACTOR equivalence in OGL, so i dont need to change my mesh vertex format? or any other choice i can do the trick without modifying the vertex format? thanks a lot.
  11. hello, To clarify what i want to say, here is an example : i use two thumbs to control player's yaw and pitch, both thumbs are touched down on the screen, later at the moment i received a 'moved' event, how do i know the received event is used for controlling the yaw or pitch of the player? in this case, if there is a way to know which touchBegin the current 'moved' event belongs to would be very helpful, what do you think? thanks a lot.
  12. hi there it's wired that the pick ray on iphone simulator is always missing target while everything is ok on windows, does anyone have the same problem? or please shed some light what's going on with the iphone screen, thank you.
  13. opengl batch rendering

    thanks bubu LV, that's a great hint about using 'glBufferSubData', i'll try it as soon as possible. it draws perfect when not using VBO, anyway the way to setup pointers are as follows : struct vertex_t { float3 pos; float2 uv; unsigned long clr; }; vertex_t vb[4]; vb[0].set(float3(-1, 1, 0), float2(0, 0), 0xFFFFFFFF); vb[1].set(float3( 1, 1, 0), float2(1, 0), 0xFFFFFFFF); vb[2].set(float3( 1, -1, 0), float2(1, 1), 0xFFFFFFFF); vb[3].set(float3(-1, -1, 0), float2(0, 1), 0xFFFFFFFF); // remember to use glBufferSubData' instead glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(vertex_t), vb, GL_DYNAMIC_DRAW); glVertexPointer(3, GL_FLOAT, sizeof(vertex_t), vb); glTexCoordPointer(2, GL_FLOAT, sizeof(vertex_t), &vb->uv); glColorArray(4, GL_UNSIGNED_BYTE, sizeof(vertex_t), &vb->clr);
  14. opengl batch rendering

    hi there i searched the gamedev but seems no perfect match : single vertex buffer and let the driver to decide where to place the buffer, directx equalient : D3DUSGAE_DYNAMIC | D3DUSAGE_WRITEONLY、D3DPOOL_DEFAULT, create an index buffer in the same way as above vertex buffer. in each frame, lock and fill the vertex buffer with vertices have same rendering property, then render. here is my opengl implementation : 1. on initialization, create the vertex buffer glGenBuffers(1, &myVB); glBindBuffer(GL_ARRAY_BUFFER, myVB); glBufferData(GL_ARRAY_BUFFER, 2500_verts, 0, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); glGenBuffers(1, &myIB); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, myIB); glBufferData(GL_ELEMENT_ARRAY_BUFFER, 3000_FACES, 0, GL_DYNAMIC_DRAW); 2. in each frame : // vertex buffer glBindBuffer(GL_ARRAY_BUFFER, myVB); glBufferData(GL_ARRAY_BUFFER, teapot_vert_num, teapot_vb, GL_DYNAMIC_DRAW); glVertexPointer(...); glTexCoordPointer(...); glColorPointer(...); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_COLOR_ARRAY); // index buffer glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _ib); glBufferData(GL_ELEMENT_ARRAY_BUFFER, teapot_indices_num, teapot_ib, GL_DYNAMIC_DRAW); // draw glDrawElements(GL_TRIANGLES, teapot_face_num, GL_UNSIGNED_SHORT, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); the program crashed when executing 'glDrawElements', what's missing here? what's the correct way to batch render with VBO's ? thank you very much. p.s. the program will be running on a mobile device, so its should be openGLES.
  15. hi thanks KulSeran for reminding, you are right, its bad habbit and i will not memset it again. there is another thing i wanted to ask in my above post, but removed because i thought its pretty irrelevant, that is : do you use boost in your final game project? boost is great and personally i think their members are all genius, just think about mpl, spirit, etc. i myself use boost (part of them)a lot but that's just limited to those non-real-time projects : terrain editor, model exporters, tools for designers etc. im hesitated to use boost in final game project for two reasons : 1. it wont improve the performance compared with the combo of cpp + stl 2. not everyone is familiar with the boost library, use boost a lot may cause troubles to successor programmers of the project. what do you think? several years ago i read an article somewhere about the principle of 'KISS', keep it simple and stupid, personally i think i am with the author.