Click here to Skip to main content
15,889,096 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regarding Addition of Items in Tree Control by Type. Pin
janaswamy uday24-Oct-10 5:07
janaswamy uday24-Oct-10 5:07 
QuestionMenu Enabling Pin
Anil Kumar.Arvapalli23-Oct-10 2:53
Anil Kumar.Arvapalli23-Oct-10 2:53 
AnswerRe: Menu Enabling Pin
Maximilien23-Oct-10 3:27
Maximilien23-Oct-10 3:27 
GeneralRe: Menu Enabling Pin
Anil Kumar.Arvapalli23-Oct-10 3:44
Anil Kumar.Arvapalli23-Oct-10 3:44 
GeneralRe: Menu Enabling Pin
Maximilien23-Oct-10 6:02
Maximilien23-Oct-10 6:02 
GeneralRe: Menu Enabling Pin
Anil Kumar.Arvapalli23-Oct-10 21:33
Anil Kumar.Arvapalli23-Oct-10 21:33 
GeneralRe: Menu Enabling Pin
Maximilien24-Oct-10 4:25
Maximilien24-Oct-10 4:25 
QuestionHow to get mouse location in openGL Pin
Mohamed_Khalil23-Oct-10 1:55
Mohamed_Khalil23-Oct-10 1:55 
Hello buddies,

I'm working with openGL to draw line

Im using VC++ 2008 express
<br />
#include <glut.h><br />
#include <math.h><br />
<br />
GLfloat static x = 0.0;<br />
GLfloat static y = 0.0;<br />
//GLfloat static x2 = 0.0;<br />
//GLfloat static y2 = 0.0;<br />
<br />
<br />
// Define true and false conditions I will use them later on <br />
typedef int BOOL;<br />
#define FALSE  0<br />
#define TRUE 1<br />
<br />
static BOOL button_down = FALSE;<br />
<br />
void draw_line(int x,int y) <br />
//the points  invoked here from mouse motion function<br />
{<br />
	<br />
	glBegin(GL_LINE);<br />
	glPointSize(3.5); //size of the point<br />
	glColor3f(1.0,0.0,0.0); // red line<br />
	glVertex2f(x,y); //start point<br />
	glVertex2f(x,y); //end point of the line<br />
	<br />
	glFlush();<br />
	glEnd();<br />
}<br />
<br />
<br />
<br />
void mouse(int button,int state,int x,int y)<br />
{<br />
	if<br />
	 <br />
		( state == GLUT_DOWN) <br />
	{<br />
		button_down = TRUE;<br />
	}<br />
<br />
<br />
	if<br />
	<br />
<br />
	(state == GLUT_UP)<br />
	{<br />
		button_down = TURE;<br />
	} <br />
}<br />
<br />
void init(void)<br />
{<br />
	glClearColor(0.0, 1.0, 0.0, 1.0); //BG color<br />
	glMatrixMode(GL_PROJECTION); <br />
	glLoadIdentity();<br />
	<br />
}<br />
<br />
<br />
void motion(int x,int y)<br />
<br />
{	<br />
	if(button_down)<br />
	{<br />
		<br />
		<br />
<br />
}<br />
<br />
	<br />
}<br />
void display(void)<br />
{<br />
	glClear(GL_COLOR_BUFFER_BIT); //clear buffer<br />
	glFlush();<br />
	glutSwapBuffers();<br />
}<br />
<br />
<br />
<br />
<br />
int main(int argc, char** argv)<br />
{<br />
glutInit(&argc,argv);<br />
glutInitWindowSize(ww,hh); //globally defined initial window size<br />
glEnable(GL_DEPTH);<br />
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);<br />
glutCreateWindow("draw_line");<br />
init();<br />
glutMotionFunc(motion);<br />
glutMouseFunc(mouse); //register mouse event<br />
<br />
glutDisplayFunc(display);<br />
glutMainLoop();<br />
}



When the mouse press in location it would send the x and y values to draw the start point of the line then i have to release the button to point the end point of the line
So, What I suppose to change the value of x and y in motion function
QuestionChanging the location of a CFileDialog. Pin
rentzk22-Oct-10 15:45
rentzk22-Oct-10 15:45 
AnswerRe: Changing the location of a CFileDialog. Pin
rp_suman22-Oct-10 22:10
rp_suman22-Oct-10 22:10 
AnswerRe: Changing the location of a CFileDialog. Pin
Richard MacCutchan22-Oct-10 22:47
mveRichard MacCutchan22-Oct-10 22:47 
GeneralRe: Changing the location of a CFileDialog. Pin
rentzk23-Oct-10 17:43
rentzk23-Oct-10 17:43 
GeneralRe: Changing the location of a CFileDialog. Pin
Richard MacCutchan23-Oct-10 21:31
mveRichard MacCutchan23-Oct-10 21:31 
GeneralRe: Changing the location of a CFileDialog. Pin
rentzk24-Oct-10 17:56
rentzk24-Oct-10 17:56 
GeneralRe: Changing the location of a CFileDialog. Pin
Richard MacCutchan24-Oct-10 22:24
mveRichard MacCutchan24-Oct-10 22:24 
GeneralFound the problem Pin
rentzk25-Oct-10 7:38
rentzk25-Oct-10 7:38 
GeneralProject type for remote file access Pin
seifwen22-Oct-10 10:25
seifwen22-Oct-10 10:25 
GeneralRe: Project type for remote file access Pin
Moak22-Oct-10 10:37
Moak22-Oct-10 10:37 
GeneralRe: Project type for remote file access Pin
seifwen22-Oct-10 11:29
seifwen22-Oct-10 11:29 
GeneralRe: Project type for remote file access Pin
Moak23-Oct-10 2:06
Moak23-Oct-10 2:06 
GeneralRe: Project type for remote file access Pin
seifwen23-Oct-10 3:57
seifwen23-Oct-10 3:57 
QuestionEnable lan connection for win7 using INetConnection Pin
manojsaxena_mca22-Oct-10 2:31
manojsaxena_mca22-Oct-10 2:31 
JokeRe: Enable lan connection for win7 using INetConnection Pin
josda100022-Oct-10 6:42
josda100022-Oct-10 6:42 
GeneralRe: Enable lan connection for win7 using INetConnection Pin
manojsaxena_mca24-Oct-10 21:29
manojsaxena_mca24-Oct-10 21:29 
AnswerRe: Enable lan connection for win7 using INetConnection Pin
krmed22-Oct-10 7:11
krmed22-Oct-10 7:11 

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.