Click here to Skip to main content
15,885,985 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
K3 Reviews9-Oct-23 5:18
K3 Reviews9-Oct-23 5:18 
GeneralRe: SharpDX MediaFoundation and DirectShow Pin
SEO3 Softrix13-Dec-22 23:47
SEO3 Softrix13-Dec-22 23:47 
QuestionPygame image wont show up until I close the window Pin
c0d3r1/212-Jul-20 11:04
c0d3r1/212-Jul-20 11:04 
AnswerRe: Pygame image wont show up until I close the window Pin
Richard MacCutchan12-Jul-20 21:24
mveRichard MacCutchan12-Jul-20 21:24 
QuestionOpenGL stencil in 2D - advanced (?) issues Pin
Vaclav_10-May-20 5:32
Vaclav_10-May-20 5:32 
QuestionOpenGL removing "objects" - how ? Pin
Vaclav_9-Apr-20 9:53
Vaclav_9-Apr-20 9:53 
AnswerRe: OpenGL removing "objects" - how ? Pin
Graham Breach9-Apr-20 21:22
Graham Breach9-Apr-20 21:22 
GeneralRe: OpenGL removing "objects" - how ? Pin
Vaclav_10-Apr-20 5:35
Vaclav_10-Apr-20 5:35 
As a general "rule" NOT to invite uncalled for criticism on my under construction code I am therefore very reluctant to post code.
However, every rule has an exception so here is the latest implementation of "write text message" to OpenGL window.
It writes the message, but in wrong position - irrelevant for now.
(The disabled #ifdef / #endif code was added and that is why the message is written in wrong raster position.The raster position code must be in wrong place. )
It is my understanding that OpenGL keeps the data - bitmap in this case - in video card hardware. So to override / update the data I have to access that particular hardware .
Or in another words - OpenGL "variable / object" cannot be just overwritten like C code.

So I believe I need to keep track of "matrix" where the initial bitmap is written and then
glLoadIdentity();
should clear the entire matrix.

Correct me if I am wrong, but glClear would not work SELECTIVELY , it would clear entire buffer.( I did neglected to add "selectively" to the post title )



C++
<pre>//display
// normal parametrized function
// passive
void OpenGL_text(char *message, float x, float y, float z) {

//#ifdef BYPASS
	printf("\nOPENGL TRACE OpenGL  @function %s  @line %i \n", __FUNCTION__,
	__LINE__);

	printf("\nOPENGL TRACE STOP passed message %s @line %i\n", message,
	__LINE__);
//#endif passive

	char menu[80];
	strcpy(menu, message); // local copy ??
	int len;
	len = strlen(menu);
	glColor3f(1, 1, 1);    // white text

//#ifdef BYPASS
	{ // GL_PROJECTION block
		glMatrixMode( GL_PROJECTION); // ??
		glPushMatrix();               // there is only one (?)
		glLoadIdentity();             // clear projection matrix  - why (?)

		gluOrtho2D(0, 500, 0, 500);   // MN !!
		{ // GL_MODELVIEW block
			glMatrixMode( GL_MODELVIEW);
			glPushMatrix();

			glLoadIdentity();         // clear bitmap (?)
//#endif
			glRasterPos3f(x, y, z); // wrong !! text start postion

			for (int i = 0; i < len; ++i) {
				glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, menu[i]);
			}
//#ifdef BYPASS
			glPopMatrix();        // GL_MODELVIEW
		} // GL_MODELVIEW block
		glMatrixMode( GL_PROJECTION);
		glPopMatrix();
	} // GL_PROJECTION block
	glMatrixMode( GL_MODELVIEW);
//#endif

}


GeneralRe: OpenGL removing "objects" - how ? Pin
Graham Breach10-Apr-20 6:45
Graham Breach10-Apr-20 6:45 
GeneralSOLVED Re: OpenGL removing "objects" - how ? Pin
Vaclav_10-Apr-20 7:08
Vaclav_10-Apr-20 7:08 
GeneralRe: OpenGL removing "objects" - how ? Pin
jhonaa22-Mar-22 1:23
jhonaa22-Mar-22 1:23 
AnswerRe: OpenGL removing "objects" - how ? Pin
jhonaa22-Feb-22 1:04
jhonaa22-Feb-22 1:04 
Questiongraphviz - pinning individual graphic elements, i.e. forcing their placement? Pin
kalberts26-Feb-20 12:30
kalberts26-Feb-20 12:30 
QuestionInfographics Pin
lopoivana27-Oct-19 23:19
lopoivana27-Oct-19 23:19 
AnswerRe: Infographics Pin
Richard MacCutchan27-Oct-19 23:20
mveRichard MacCutchan27-Oct-19 23:20 
QuestionCreate 2D graphics editor Pin
Member 1455869629-Aug-19 0:51
Member 1455869629-Aug-19 0:51 
AnswerRe: Create 2D graphics editor Pin
Richard MacCutchan29-Aug-19 2:33
mveRichard MacCutchan29-Aug-19 2:33 
GeneralRe: Create 2D graphics editor Pin
Chandigarh Girl2-Sep-19 23:36
Chandigarh Girl2-Sep-19 23:36 
AnswerRe: Create 2D graphics editor Pin
Regina Hawk1-Sep-19 23:47
Regina Hawk1-Sep-19 23:47 
QuestionShould a Web designer use coding or just PSD/XD Template Pin
Member 1456898628-Aug-19 7:59
Member 1456898628-Aug-19 7:59 
Questionopengl (openTK) Pin
dspdad0107-May-19 9:55
dspdad0107-May-19 9:55 
AnswerRe: opengl (openTK) Pin
Gerry Schmitz7-May-19 11:22
mveGerry Schmitz7-May-19 11:22 
GeneralRe: opengl (openTK) Pin
dspdad0107-May-19 14:00
dspdad0107-May-19 14:00 
QuestionOpenGL GLFW/SDL emdeded into WinForms/WPF Pin
Member 1403803230-Oct-18 4:17
Member 1403803230-Oct-18 4:17 
QuestionHow do I convert iTextSharp text to outline (vectorize)? Pin
Jakob Farian Krarup6-Jun-18 19:38
Jakob Farian Krarup6-Jun-18 19:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.