Click here to Skip to main content
15,077,139 members

Comments by Santhosh G_ (Top 90 by date)

Santhosh G_ 4-Aug-16 4:16am View
   
hi,

Please provide more details of "magnifying glass/loop in opengl. (Like the one for Windows)"
Santhosh G_ 6-Apr-16 2:49am View
   
i think windows will repaint your image, and you need to call swpabuffers() too.
there are some initialisation procedure for opengl, you have to do that.

please refer this app( refer cpu version)
http://www.codeproject.com/Articles/471994/OilPaintEffect
Santhosh G_ 6-Apr-16 2:28am View
   
simple test application of texture mapping.
http://www.codesampler.com/oglsrc/oglsrc_2.htm#ogl_texture
Santhosh G_ 6-Apr-16 2:25am View
   
Above code will create a texture, and you have to draw this texture to your screen.
Following is a texture drawing sample code.

glBegin(GL_QUADS);
glNormal3d(0, 0, 1);
glTexCoord2f(0, 0);
glVertex3dv(a);
glTexCoord2f(1, 0);
glVertex3dv(b);
glTexCoord2f(1, 1);
glVertex3dv(c);
glTexCoord2f(0, 1);
glVertex3dv(d);
glEnd();

please refer "Using the Image" in the shared link.
https://www.cse.msu.edu/~cse872/tutorial4.html
Santhosh G_ 6-Apr-16 0:34am View
   
Please ensure the data is valid.

if(NULL != pFile)
{
fread(Bitmap_Data, 1280 *690 * 4 * sizeof( unsigned char ), 1, pFile);

// debug code, expect a white image displayed.
memset( Bitmap_Data, 255, 1280 *690 * 4 );
fclose(pFile);
}

also please provide the code which display this texture.

Please refer below link to get details about texture mapping.
https://www.cse.msu.edu/~cse872/tutorial4.html
Santhosh G_ 4-Dec-15 3:00am View
   
I think you can obtain the expected result by changing X,Y,Z value of the vertex.

"it works somehow but when i'm trying to change the perspective all the points just dissapear."
Why you need to change perspective ?
Santhosh G_ 15-Mar-15 5:44am View
   
Are you getting some errors with this code?
Santhosh G_ 27-Nov-14 8:35am View
   
Please post details inside b.drawCyborg() and DrawStars(). It is better to follow steps mentioned by enhzflep. Please avoid first glutSwapBuffer call from myDispkay and call it after all drawings[b.drawCyborg() and DrawStars()].

1) Call glClearColor and glClear first.
2) Call g.Draw and DrawStars next.
3) Finally, glutSwapBuffers
Santhosh G_ 22-Oct-13 14:37pm View
   
Please ensure the version of OpenGL.
CHAR* pVersion = (CHAR*)glGetString(GL_VERSION); Call this after wglMakeCurrent().

Sorry I could not find any errors in the code.
Santhosh G_ 21-Oct-13 22:47pm View
   
Please add code portion of Draw() or Onpaint, which draws the square.
And the code portion of rendering context initialisation.
You can add source code portion by selecting Improve Question link.
Santhosh G_ 21-Oct-13 13:06pm View
   
Please post your source code to identify the problem.
Santhosh G_ 20-Sep-13 10:04am View
   
" I have one task to render some in openGl Offscreen", here i can understand that the image is in a framebuffer. Offscreen rendering can be performed with a frame buffer. We can access frame buffer with opengl extensions.
Here is a sample code and details of offscren rendering. http://www.songho.ca/opengl/gl_fbo.html
Santhosh G_ 3-Jul-13 12:50pm View
   
Above code will provide the contents of the clipboard as string.
Clipboard should contain entire file path.
Santhosh G_ 1-Jul-13 11:47am View
   
If third party application need to run/start your script you have to provide your script as such.
If possible, Provide an application to third party, request them to run that application, and that application will prepare the script and execute the script.
Santhosh G_ 1-Jul-13 11:24am View
   
Start script, and after that lock the file.
// Decript script from your application and write to D:\\script.js[an example]
ShellExecute(0, L"open", L"D:\\script.js", NULL, NULL, SW_SHOWNORMAL);
HANDLE hFile1 = CreateFile(_T("d:\\script.js"), GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
//Lock the first 1024 bytes
BOOL bLocked = LockFile(hFile1, 0, 0, 1024, 0);

After execution of script delete file from the path.
Santhosh G_ 27-Jun-13 12:13pm View
   
>> But if I Change the transparency value for stls points are not shown through it.
If alpha of stls set as 0.25, then what will the Alpha of lines. Is it1.0 ?
Santhosh G_ 27-Jun-13 9:52am View
   
Which process consumes cpu ? Is it your process or any other nvidia driver supporting process like nvsc32.exe etc ?
We also faced a problem, sometimes cpu usage of my app is increased.
https://forums.geforce.com/default/topic/481759/nvoglnt-dll-33-drvcopycontext-take-a-sleep-/#3455522
Santhosh G_ 27-Jun-13 9:48am View
   
>>> But when loading Rotation Function's it takes 50% of CPU Usage in my pc. But not in others PC.
What is the behavior without rotation code in shader ? Still CPU usage is 50% or decreased?
Santhosh G_ 27-Jun-13 8:44am View
   
Please check the performance of the shader without the rotation in shader. I suspect this issue is not related to the rotation code. It might be something else, like old driver etc.
Santhosh G_ 23-Jun-13 8:58am View
   
pix[0].setTexture(2001); // create texture
pix[1].setTexture(2022); // create texture

Why 2001 and 2022 is used ? Is it texture ID?
Please provide more information about RGBpixmap.
Santhosh G_ 21-Jun-13 14:02pm View
   
Please ensure glUseProgram called before calling glGetUniformLocation.

http://www.codeproject.com/Articles/89337/GLSL-Shader-for-Interpolating-Two-Textures
Implementation of simple shader to interpolate two textures with the input value from user. Please refer GLSLShader.cpp and GLSLShader.h.
Santhosh G_ 21-Jun-13 13:42pm View
   
Please ensure parameter name and the referenced name are same.

http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocation.xml

This function returns -1 if name does not correspond to an active uniform variable in program, if name starts with the reserved prefix "gl_", or if name is associated with an atomic counter or a named uniform block.

Please ensure glUseProgram called before calling glGetUniformLocation.

http://www.codeproject.com/Articles/89337/GLSL-Shader-for-Interpolating-Two-Textures
Implementation of simple shader to interpolate two textures with the input value from user. Please refer GLSLShader.cpp and GLSLShader.h.
Santhosh G_ 4-Jun-13 15:01pm View
   
For getline, The delimiting character is the newline character ('\n'). If a pending '\n' in input stream,cin then getline immediately returns.
After cin>>x the '\n' is remained in the input stream.
http://www.cplusplus.com/reference/istream/istream/getline/
Santhosh G_ 3-Jun-13 12:39pm View
   
Please ensure required libraries for opencv is added in additional libraries.
Santhosh G_ 3-Jun-13 11:34am View
   
Is it possible to create vector as a native type, say long.
Then convert IplImage* to long while inserting an IplImage* instance to the vector and
convert long to IplImage* while retrieving IplImage* from vector.

cliext::vector<<long>> Lineimgs;

Lineimgs.push_back((long) new IplImage);
IplImage* pTemp = (IplImage*)Lineimgs[nIndex];
Santhosh G_ 2-Jun-13 8:23am View
   
Please ensure 'a' is presssed and not 'A'.
Try to debug in keypress or log key parameter from keypress function.
Above code should display a point on pressing 'a' in keyboard.
Santhosh G_ 1-Jun-13 12:51pm View
   
Is it possible to use shared memory or other inter process mechanism to share the address from "appname".
Santhosh G_ 29-May-13 22:22pm View
   
This link error indicates that certain functions import details are not available.
Please ensure glut32.lib exists, Is there any chance to have another version of glut in your linker path?. Please Check Additional lib folders, for the existance another glut.lib.
http://stackoverflow.com/questions/5159353/how-can-i-get-rid-of-the-imp-prefix-in-the-linker-in-vc
Santhosh G_ 27-May-13 11:46am View
   
MonitorMediaSensorProc will remain until the following condition satisfies.
if(g_portio->m_bCloseMediaSensorThread || *pbCloseThread)
In my suggestion MonitorMediaSensorProc should not return until the all SendData() operation completed. Restarting the thread to send each command is not a good design.
Santhosh G_ 26-May-13 5:34am View
   
If size is unknown, Use dynamic data structures like list or vector, and add each items as you needed.

But here you can allocate the array before for loop. Isn't it ?
Santhosh G_ 25-May-13 10:11am View
   
Please provide code of method()
Santhosh G_ 24-May-13 16:27pm View
   
Do you want to change the file contents, by appending some data at the end of mapped file, right ?
Santhosh G_ 23-May-13 20:41pm View
   
Here one member down voted this answer. Please give a reason for the same, then I can correct the same.
Santhosh G_ 23-May-13 11:41am View
   
Do you want to zoom controls in the dialog? Or do you need to zoom some bitmaps or image ?
Santhosh G_ 21-May-13 11:32am View
   
What is the value cs.style. Please try to add WS_OVERLAPPED in the style.
Santhosh G_ 18-May-13 14:02pm View
   
Here i expected Cents is a class, cNancy is an instance of a Cents class.
When creating an instance of Cents cNancy with an existing instance cMark copy constructor will be called. Could you please explain the problem. Do I have to explain anything else.
Santhosh G_ 13-May-13 22:08pm View
   
Now what is the problem? i can see all stack items drawn in red color with yellow background. I just modified push() and pop() to draw the background color for every frame. The above code change will not push or pop items unconditionally. Could you please explain the problem.
Santhosh G_ 13-May-13 11:55am View
   
Do you need to display the pushed char( new character) in different colored block, and all others in normal color( red) ?
Santhosh G_ 6-May-13 12:18pm View
   
copy glew32.lib from the lib path to visual studio lib path.
Download it from http://glew.sourceforge.net/install.html or any other web reosurce
Santhosh G_ 5-May-13 2:44am View
   
To parse lines and strings from a character buffer, we can use stringstream. Is it possible to use stringstream ?
Santhosh G_ 19-Apr-13 3:56am View
   
Please provide additional information about projection and viewport. If possible please provide enitre source code.
Santhosh G_ 9-Jan-13 13:47pm View
   
Please post the shader code, then we can identify the possible reason.
Compilers of some hardware venders are strict, I got different results on compiling same shader program in different machines. http://www.codeproject.com/Articles/89337/GLSL-Shader-for-Interpolating-Two-Textures#_comments
Santhosh G_ 9-Jan-13 13:42pm View
   
Try to use BYTE buffer to hold the vertex information.

"But on running the executable directly, the vertices are not rendered when the application was minimized or the focus was altered in some way." It means rendering is not happening after minimize, is it correct ?

What is the behavior while drawing with glBegin() glEnd() primitives.
Santhosh G_ 30-Dec-12 12:46pm View
   
Please add include files of CV3,CV2, and tFace.
Santhosh G_ 7-Nov-12 18:08pm View
   
The above example is similar to taking a picture of a ball by placing camera very near to the ball and placing camera very far from the ball. When camera is near to the ball, the viewing area will be small and it create ball as bigger. When camera is far from the ball, the viewing area will be bigger and the ball will become small.
Santhosh G_ 7-Nov-12 18:06pm View
   
Suppose you doubled the clipping area using glOrtho(). For 800,600 window size, you will call glOrtho( -266, 266, 200,200 ). The objects drawn in this Clipping area[in x direction -266 to 266, and in Y direction 200 to 200 ] is mapped to window region 800, 600. But the size of object[Square of size 25] is same as that of old. Here viewing area is increased, but the object size is same as that of small area. It creates a smaller size rectangle.
Santhosh G_ 6-Nov-12 9:40am View
   
Please check this http://www.codeproject.com/Questions/127011/DLL-Shared-Memory-in-Windows-7
Santhosh G_ 6-Nov-12 7:37am View
   
"C" is also tagged in the question. Anyway string::find() also an option to find the character in the string.
Santhosh G_ 5-Nov-12 17:26pm View
   
To display the bitmap in static window, you have to modify window style SS_BITMAP, and send STM_SETIMAGE message is required.
pStatic->ModifyStyle( 0, SS_BITMAP, SWP_SHOWWINDOW );
::SendMessage( pStatic->->m_hWnd, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)m_bmp.m_hObject);
Santhosh G_ 5-Nov-12 8:54am View
   
Which call gives access violation ?
I suspect (CStatic*)m_cTab1.GetDlgItem(6))
Santhosh G_ 4-Nov-12 7:29am View
   
Use c_str() function of string.
strchar( strObj.c_str(), '&' );
Santhosh G_ 2-Nov-12 1:36am View
   
MSDN link may help you.
I also faced this issue in my application, when converting VC6 app to VC7, controls style is not changed.
We got XP style controls, buttons, radio button, edit controls etc by applying above things.
Santhosh G_ 31-Oct-12 0:02am View
   
Is it bucket sort algorithm implementation?
http://en.wikipedia.org/wiki/Bucket_sort
Santhosh G_ 27-Oct-12 4:51am View
   
What is the implementation of makeResult() ?
Please attach to a debugger and find which function creates the access violation
Santhosh G_ 27-Oct-12 1:16am View
   
// Message declaration.
const int SET_GUI_UPDATE_MESSAGE = WM_USER + 1 // User Mesasge

// message handler modification.

// Add message handler in message map.
ON_MESSAGE( SET_GUI_UPDATE_MESSAGE, OnGUIUpdateMessage )


// Message handler implementation.
void MyDlgClass::OnGUIUpdateMessage( WPARAM dwWParam_i, LPARAM dwLParam_i)
{
// Process GUI operation..
}

// Non-GUI thread, sending message to GUI thread after non gui operations.
UINT MyThread()
{
// Non gui operations

...

// Send message to GUI for GUI actions
ptrDlgHandle->PostMessage( SET_GUI_UPDATE_MESSAGE, 0,0 );
}
Santhosh G_ 27-Oct-12 0:57am View
   
http://www.codeproject.com/Answers/474330/timerplusandplusthreadplusinplusmfcplusdoesplusnot#answer2
Here non gui actions are performed from a worker thread and after that send message to gui.
Santhosh G_ 21-Oct-12 18:10pm View
   
char cOutBuff[5][25]; // Buffer for 5 words.
char cInBuffer[250];
strcpy(cInBuffer,"AllPartsOfTheWord");
// Length of Words in an array
int nWordLengths[5] = {3,5,2,3,4};
int nOfset = 0;
for( int nI =0; nI<5;nI++)
{
// Copies part of a string.
memcpy(cOutBuff[nI], cInBuffer+nOfset, nWordLengths[nI]);
// Set Null at end of a string.
cOutBuff[nI][nWordLengths[nI]] = 0;

// Increment offset.
nOfset += nWordLengths[nI];
}
Santhosh G_ 21-Oct-12 4:41am View
   
You can use memcpy with an offset for source parameter.

memcpy(buffn, actualstring +offset, ncurrentlength );
buffn is n th buffer, offset is the length of all strings from buff0 to buffn, ncurlength is the length of current string.
Santhosh G_ 20-Oct-12 8:47am View
   
You have to parse the string to find "\n" and draw it in new line. If "\t" is in ini file, then you have to put 4 space for that and like that. Like that you have to consider all special characters for drawing.
Sorry for misunderstanding.
Santhosh G_ 20-Oct-12 8:38am View
   
If possible, replace all combinations of before display.
Other option is to implement drawing of the string based on the special characters.
Santhosh G_ 20-Oct-12 8:01am View
   
Please post the compiler error message. May be lineral() function is not declared in your header file.
Santhosh G_ 19-Oct-12 23:33pm View
   
Is there any calls to QueryPerformanceCounter in your code ?
Santhosh G_ 18-Oct-12 2:43am View
   
ptrDlgHandle is the handle to the window. It can be declared in global scope, and assign m_hWnd to it from OnInitDialog().
Or you can use findwindow to get the GUI from the thread.
Santhosh G_ 17-Oct-12 9:49am View
   
http://www.codeproject.com/Articles/3175/Displaying-Bitmap-with-Scrolling

This article might be helpful for you.
Santhosh G_ 17-Oct-12 9:09am View
   
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364957(v=vs.85).aspx
Please check Community Additions section, Details of using this API with VS 6.0 is explained. You have to use LoadLibrary to access this library,
Santhosh G_ 17-Oct-12 3:30am View
   
For smooth move effect, you can use a timer to move between two points.
The movement in each timer interval should be small to prepare a smooth effect.
Santhosh G_ 15-Oct-12 7:16am View
   
Please ensure SwapBuffer() called after all drawing.
If possible please provide code of OpenGL initialization and drawing code.
Santhosh G_ 12-Oct-12 11:33am View
   
What about the sc_surf_data_14.gif,
What are the inputs to prepare these images ?
Do you have entire temperature distribution ?
Or temperature of one or two locations.
Santhosh G_ 12-Oct-12 11:20am View
   
What are the inputs for your application ?
For GradientMap.gif, you need distribution of Temperature, right ?
Santhosh G_ 12-Oct-12 8:48am View
   
After DoModal(), please call ReleaseMutex() and CloseHandle() to close the mutex instance.
Santhosh G_ 12-Oct-12 8:22am View
   
Its not required to have the same name of Dialog name.
Any unique name to indicate your dialog. It should be unique. If anyone else opened a mutex with same name, your dialog will not appear.
Santhosh G_ 12-Oct-12 6:14am View
   
Simply creating a CDialog instance will not give a valid window handle.
TestDlg* pDlg = new TestDlg();
HWND hNullHandle = pDlg->GetSafeHwnd(); // Handle will be NULL
pDlg->Create( IDD_DIALOG_ID, 0 );
HWND hValidaHandle = pDlg->GetSafeHwnd(); // Handle will be Valid
pDlg->ShowWindow( SW_SHOW );
Santhosh G_ 12-Oct-12 5:36am View
   
If it is DoModal() to display the dialog, how you will get more than one dialog ?
Are you creating new process, or new thread to display new dialog ?
Santhosh G_ 12-Oct-12 3:32am View
   
// The handle to be tested.
HWND hWindow = GetSafeHwnd();

// Check whether the window is still there.
BOOL bWindowAlive = IsWindow( hWindow );
Santhosh G_ 11-Oct-12 3:48am View
   
What kind of data you will get from GDAL library ? Is it in any image format like RGB etc.
Santhosh G_ 10-Oct-12 21:33pm View
   
This may give some information realated to Ribbon control http://stackoverflow.com/questions/4592203/find-window-handle-of-a-ribbon-button
Santhosh G_ 10-Oct-12 20:58pm View
   
Please use spy++ tyo find the parent and ID of the control.
Santhosh G_ 10-Oct-12 2:55am View
   
If the object is similar to quad, then you can map texture coordinates easily.
Please check these links,
http://www.nvidia.com/object/cube_map_ogl_tutorial.html
http://jerome.jouvie.free.fr/opengl-tutorials/Tutorial11.php

Santhosh G_ 10-Oct-12 1:46am View
   
For mapping textures for an un-even structure or polygons, Split the shape into triangles. And provide texture coordinate for each vertex of the triangle.
Santhosh G_ 8-Oct-12 20:11pm View
   
Deleted
if(oldpathName!=pathName){ memDC.DeleteDC(); memDC.CreateCompatibleDC(pDC);

cImg.Destroy(); if(cImg.Load((LPCTSTR)pathName)!=S_OK)

AfxMessageBox(L"Error"); memDC.SelectObject(cImg);


pDC->BitBlt(0, 0, cImg.GetWidth(), cImg.GetHeight(), &memDC, 0, 0, SRCCOPY);
ValidateRect(&s);


oldpathName=pathName;erase=true;}

On changing file name, ValidateRect() is required, right ?
Santhosh G_ 20-Sep-12 7:04am View
   
strcpy(buf1313,szDate);
strcat(buf1313," ");
strcpy(buf1313,szTime);
after copying date, you are overwriting it with time.
strcpy(buf1313,szTime); use strcat instead of strcpy.
Santhosh G_ 17-Sep-12 2:54am View
   
http://stackoverflow.com/questions/2166473/how-to-create-a-multicolumn-listbox
Santhosh G_ 10-Jul-12 12:48pm View
   
Please prepare vertex buffer with fX and fY values, and call it with glDrawArrays. Please try the following code..


int M_IN_DEGREE = 370;
int N_IN_DEGREE = 100;
int nCount = 1;
float stVertexArray[2*360];

stVertexArray[0] = 0.0;
stVertexArray[1] = 0.0;

for( int nR =N_IN_DEGREE; nR < M_IN_DEGREE; nR++ )
{
float fX = sin((float)nR * DEGREE_TO_RAD ) ;
float fY = cos((float)nR * DEGREE_TO_RAD );
stVertexArray[nCount*2] = fX;
stVertexArray[nCount*2 + 1] = fY;
nCount++;
}

glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer( 2, GL_FLOAT, 0, stVertexArray );
glDrawArrays( GL_LINE_LOOP, 0, nCount );
Santhosh G_ 22-Jun-12 10:28am View
   
If issue is related to unwanted WM_PAINT message, then ValidateRect can solve.
What are the operations in your drawing ?
Is there any chance to consume much time for the processing ?
Santhosh G_ 22-Jun-12 8:16am View
   
Thanks Richard, I corrected the answer.
Santhosh G_ 4-Mar-12 22:31pm View
   
This link will be helpful.

http://www.opengl.org/wiki/Getting_started
Santhosh G_ 29-Feb-12 12:59pm View
   
What is the size and format of texture?
If memory allocated is not enough for the texture size, there is a chance for access violation.
Santhosh G_ 29-Jan-12 12:59pm View
   
Is there any shaders enabled before calling drawShaft()?

Hope floor.enable(); will call glEnable( GL_TEXTURE_2D ); and floor.disable() will call glDisable( GL_TEXTURE_2D );.

Please confirm Texture class properly binds the expected texture.
Santhosh G_ 2-Oct-11 0:07am View
   
How you are displaying image? Texture mappping may cause such isues.
Santhosh G_ 3-Sep-10 11:52am View
   
Could you please post the code written in Idle function.