If you know texture size before you upload, then better create texture with glTexImage2D, then use PBO + glTexSubImage2d combo to update texture data. Another issue can be GL_RED. I think it is not...
Type: Posts; User: yooyo
If you know texture size before you upload, then better create texture with glTexImage2D, then use PBO + glTexSubImage2d combo to update texture data. Another issue can be GL_RED. I think it is not...
When your OpenGL app receive message from other app, just invalidate opengl window. Use InvalidateRect call to do this.
You can rener scene to texture, duplicate, and use a copy in shader.
This is just easies possible example. Not designed for real world usage.
Whole point behind PBO is to alow CPU and GPU runf without wainting on each other. If you neet to stream video to GPU, use this:
- create PBO pool, each PBO buffer should be able to fit whole frame....
memcpy and CopyMemory is slow. Try with:
- http://www.gamedev.net/community/forums/topic.asp?topic_id=78382
- http://www.cs.virginia.edu/stream/FTP/Contrib/AMD/memcpy_amd.cpp
This must be faster. Try this:
1. create two 1920x1080x4 PBO's.
2. Render
3. bind PBO2, lock, memcpy to sysmem, unlock
4. bind PBO1, glReadPixels
5. swapbuffers
6. swap PBO1 & PBO2 names
7....
Texture streaming.
Without PBO, during glTexSubImage2D call, CPU is blocked and wait. With PBO, glTexSubImage2D call return immediatly.
Dont use plain memcpy. Use some faster memcopy code that...
It is not allowed to access to same GL context from different applications (processes). Depending on your OS there is a tweaks how to do similar thing.
Glyph is just character shape description. If you want to do any drawings on screen you need glyphs. Kerning pairs is described in font, but layout, paragraphs, etc is not.. you have to do it by...
Use FreeType.
1. InitFreeTypeLib();
2. Create face: FT_New_Face( library, fontname, 0, &face );
3. Set char size: FT_Set_Char_Size (it is 26.6 fixed numbers)
4. for each letter in paragraph find...
Yes.. Im using that approach because I want to decouple my rendering loop from windows messaging. In UI thread im handling sizing, mouse and keyboard messages, and post specific messages to WT.
@MonoFocus:
Totally wrong. Usually I create window in UI thread and pass HWND to workerthread. WT read DC from HWND then create RC and initialise all extension.
Did you released gl context and dc when on dialog close?
If you have good graphics card and proper drivers you already have latest OpenGL.
check this http://glew.sourceforge.net/
Dont crosspost!
Use gluUnProject for that. You will need screen X, scree Y and screen Depth. Without depth you cant get correct 3d coordinate.
If object is additionally transformed by vertexshader (for example...
This is wrong PBO usage pattern. Never map buffer right after posted read/write operation.
Without PBO glGetTexImage force app on CPU to wait until GPU finish its job and copy data to sysmem.
With...
According to realtech GLView database, WGL_ARB_buffer_region is present on FireGL cards. It's a WGL extension.. not GL extension.. To get list of WGL extensions use wglGetExtensionsStringARB.
Try to use WGL_ARB_buffer_region (if exist). If not then:
1. Draw scene to texture, refresh as you need. Use FBO or PBuffer, and if everything fails, draw to backbuffer and use glCopyTexImage2D...
Any gl errors? Did you setup modelview and projection matrices and did you setup viewport.
Few more questions...
mesh.FloatArray.Length returns number of elements in float array or size in bytes?...
Depending how do you pack vertex attributes in array you must adjust stride. There is a two ways how to store data in VBO. Remember one float takes 4 bytes of memory:
1. store all positions...
Here is a problem:
Gl.glBindBuffer(Gl.GL_ARRAY_BUFFER, vbo[mesh.material][0]);
Gl.glVertexPointer(3, Gl.GL_FLOAT, 0, 0);
Gl.glTexCoordPointer(2, Gl.GL_FLOAT, 0, 3);...
This is from MESA gluLookAt impl.
static void __gluMakeIdentityf(GLfloat m[16])
{
m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0;
m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0;...
Can you post how do you use gluLookAt?