Search Results

Search found 5 results on 1 pages for 'dororo'.

Page 1/1 | 1 

  • OpenGl texture mapping blocking colours on FreeType?

    - by Dororo
    I'm using FreeType in order to allow fonts to be used in OpenGL. However, I'm having a problem where I cannot change the font colour whenever I do texture mapping. No matter what I select using glColor3f it will just come out white. The texture works fine. glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); glColor3f(0.5,0.0,0.5); glPushMatrix(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glBindTexture(GL_TEXTURE_2D, texName); glBegin(GL_POLYGON); glTexCoord2f(0,1); glVertex2f(-16,-16); glTexCoord2f(0,0); glVertex2f(-16,16); glTexCoord2f(1,0); glVertex2f(16,16); glTexCoord2f(1,1); glVertex2f(16,-16); glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glPopMatrix(); glColor3f(1,0,0); print(our_font, -300+screenWidth/2.0, screenHeight/2.0, "fifty two - %7.2f", spin); This is the problem code, I can confirm that drawing a polygon beneath this code will indeed make it red. The text is not changing to red though which it should; if you remove the texture mapping above it will turn red again, I can only think it is a problem with enabling and disabling and I've forgotten to do something...?

    Read the article

  • Semaphores in unmanaged code

    - by Dororo
    I've been using the Semaphore class to create semaphores. However, the examples use managed code (requires /clr), and I need to use unmanaged code because it seems FreeType doesn't like working with managed code. How can I create two simple threads which use a semaphore in unmanaged code?

    Read the article

  • Creating semaphores with unmanaged code in C++

    - by Dororo
    I've been using the MSDN Library to create semaphores, located at: http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx However, the examples are using Managed code (requires /clr), and I need to use Unmanaged code because FreeType doesn't like working with Managed code it seems. How would I go about creating 2 simple threads which use a semaphore if I'm using unmanaged code? Many thanks for your help.

    Read the article

  • Identifying memory leaks in C++

    - by Dororo
    I've got the following bit of code, which I've narrowed down to be causing a memory leak (that is, in Task Manager, the Private Working Set of memory increases with the same repeated input string). I understand the concepts of heaps and stacks for memory, as well as the general rules for avoiding memory leaks, but something somewhere is still going wrong: while(!quit){ char* thebuffer = new char[210]; //checked the function, it isn't creating the leak int size = FuncToObtainInputTextFromApp(thebuffer); //stored in thebuffer string bufferstring = thebuffer; int startlog = bufferstring.find("$"); int endlog = bufferstring.find("&"); string str_text=""; str_text = bufferstring.substr(startlog,endlog-startlog+1); String^ str_text_m = gcnew String(str_text_m.c_str()); //some work done delete str_text_m; delete [] thebuffer; } The only thing I can think of is it might be the creation of 'string str_text' since it never goes out of scope since it just reloops in the while? If so, how would I resolve that? Defining it outside the while loop wouldn't solve it since it'd also remain in scope then too. Any help would be greatly appreciated.

    Read the article

  • How to convert from one co-ordinate system to another (graphics)

    - by Dororo
    I've been having issues with this for a little while now. I feel like I should know this but I can't for the life of me remember. How can I map the screen pixels to their respective 'graphical' x,y positions? The co-ordinate systems have been configured to start at the bottom left (0,0) and increase to the top-right. I want to be able to zoom, so I know that I need to configure the zoom distance into the answer. Screen |\ Some Quad | \--------|\Qx | \ Z | \ | \ \|Qy \ | Sx\ |Sy \| I want to know which pixels on my screen will have the quad on it. Obviously as Z decreases, the quad will occupy more of the screen, and as Z increases it will occupy less, but how exactly are these calculated? Thanks for any help.

    Read the article

1