glDrawElements

Hi All,

I’m developing a OpenGl Program on win7 x86 32bit VM using GRID K2 GPU.

my program is like Pseudo code below

static BYTE* ptr = malloc(BUFFER_SIZE);

frame begin 

some code

for()
{
       1、modify the buffer of ptr pointer
       2、glVertextPointer(……,ptr);
       3、glDrawElement();
}

glSwapBuffer();

sometimes,A Write Memory Violation was throwed on the step 1 when i trying to modify the buffer of ptr pointer。

when i debug this issue,i found that glDrawElement call VirtualProtect for ptr pointer and making the buffer readonly.

how can i fix this issue or any tips for me

Any suggestions greatly appreciated!
Thanks

these days, i found that if ptr is static memory region, the Write Memory Violation can not be throwed.

It’s really werid.

Any suggestions greatly appreciated!
Thanks

when i use debug tools ,i found it show a message “__wglImpWWVirtualAddWatch”.

so……

what’s the meaning of “__wglImpWWVirtualAddWatch”? how to triger this function?

Any suggestions greatly appreciated!
Thanks