Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / GLCanvas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. GLCanvas
#4309
Posted by: styggentorsken 2004-06-02 03:42:45
I'm trying to compile some samples using GLCanvas, but I have lots of trouble getting the libriary up and working. Im using dev-c++.
First I tried to install the 2.5.1 devpack from upCASE.de, but then I could not even compile my "Helloworld"-program.
Then I tried to compile my own 2.4.2 libriary with GLCanvas support using the guide on upcase.de, but  i got one problem. This is my console

C:\wxWindows\src\msw>set PATH=%PATH%;c:\dev-cpp\bin
C:\wxWindows\src\msw>set PATH=%PATH%;c:\wxWindows\bin

C:\wxWindows\src\msw>make -f makefile.g95 clean
rm -f *.o
rm -f ole/*.o
rm -f *.bak
rm -f core
rm -f ../common/y_tab.c
rm -f ../common/lex_yy.c
rm -f ../common/*.o
rm -f ../common/*.bak
rm -f ../generic/*.o
rm -f ../generic/*.bak
rm -f ../html/*.o
rm -f ../zlib/*.o
rm -f ../zlib/*.bak
rm -f ../png/*.o
rm -f ../png/*.bak
rm -f ../jpeg/*.o
rm -f ../jpeg/*.bak
rm -f ../tiff/*.o
rm -f ../tiff/*.bak
rm -f ../regex/*.o
rm -f ../regex/*.bak

C:\wxWindows\src\msw>make -f makefile.g95
mkdir ..\..\lib\mswd
mkdir ..\..\lib\mswd\wx
cp ../../include/wx/msw/setup.h ../../lib/mswd/wx/setup.h
process_begin: CreateProcess((null), cp ../../include/wx/msw/setup.h ../../lib/m
swd/wx/setup.h, ...) failed.
make (e=2): Systemet finner ikke angitt fil.    (The system can't find the file)
make: *** [../../lib/mswd/wx/setup.h] Error 2


I have worked 3 days with this problem so I would be very happy if someone could help.
Message2. Re: GLCanvas
#4313
Posted by: upCASE 2004-06-02 14:55:23
Hi!
Well, first of all maybe check this thread http://g.yi.org/forum/read.php?13,4080. We discussed an issue with the 2.5.1 devpack there and it seems to be solved. Although I don't give a guarantee, I'm still pretty sure that it works :)

BTW: The usage statistics for my site show 1.1 GB traffic... Glad I got that domain.

For 2.4.2:
cp ../../include/wx/msw/setup.h ../../lib/mswd/wx/setup.h
process_begin: CreateProcess((null), cp ../../include/wx/msw/setup.h ../../lib/m
swd/wx/setup.h, ...) failed.
So, well, cp failed... That's the reason why make (or mingw32-make) won't find setup.h in the given location. Copy setup.h manually and try again.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: GLCanvas
#4317
Posted by: styggentorsken 2004-06-02 21:26:23
Im now trying to fix the "multiple definition of "vtable for ...""-problem
I didn't understand what I am supposed to do with the two .GZ-files?
I installed the two .exe-files directly into /dev-cpp

http://g.yi.org/forum/read.php?13,4080

after I had tried to install minGW3.1.0-1 into dev-cpp/ there were no files in the /dev-cpp/mingw directory
Message4. Re: GLCanvas
#4318
Posted by: upCASE 2004-06-02 22:18:21
Hi!
If you want mingw to be "updateable", better install it in a seperate dir, not in dev-cpp/bin. Use the exe-only version of dev-c++ and set the paths to your mingw installation. That way you can simply update by using the installer or the zips.

The .tar.gz are actually archives you'll need to extract over the new installation.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message5. Re: GLCanvas
#4320
Posted by: styggentorsken 2004-06-02 23:50:49
Im not really sure how I set up the exe-only version of dev-cpp
In the compiler setup I clicked "folders" and set
c:\mingw\bin   - at binaries
c:\mingw\lib   - at libriary
c:\mingw\include   - at c-includes

+5 others     -at c++-includes
then i clicked "delete invalid"
but my compiler is still not operational, it says

Compiler: Default compiler
Building Makefile: "E:\Kompilator\Win\Eksempler\2\Makefile.win"
Executing  make...
make.exe -f "E:\Kompilator\Win\Eksempler\2\Makefile.win" all
Execution terminated

edit:  figured it out, its name isn't make.exe anymore
       gotta go,  see you perhaps tomorow

Message6. Re: GLCanvas
#4328
Posted by: styggentorsken 2004-06-03 14:23:28
What I have done so far:
   1 Installed dev-c++ executable only
   2 Installed imagelib, wxWindows 2.5.1 devpack + contribs
   3 Installed  from MinGW-3.1.0-1.exe and gdb-5.2.1-1.exe to c:\MinGW
   4 Extracted from the two gz-files and put the files into different folders in
     c:\Mingw
   5 Checked   gcc -v  from the console    (says 3.3.1)
   6 Have not found any files which are the same in dev-cpp/bin dev-cpp/lib
     c:\MinWG\bin c:\MinWG\lib  
   7 Set up the paths in dev-cpp

I still can't compile wxWidgets-programs (I get the multiple definitions error).
Have I forgot anything?
Is there a simpler way to install MinGW 3.3.1? Maybe it isn't installed correctly?
Message7. Re: GLCanvas
#4330
Posted by: upCASE 2004-06-03 15:18:06
Hi!
Well, it should work... :(
Have you tried that with a new, blank project from the template? Recompiled the whole project?

If nothing else works or nobody else has a brilliant idea, I suppose you'll have to compile wxWidgets yourself or try with a 2.4.2 devpack...
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message8. Re: GLCanvas
#4334
Posted by: styggentorsken 2004-06-03 21:53:23
Wohoo, made it to compile wxWidgets again !!! I forgott to restart with a brand new wxWidgets project
I also tried the code from this page:
http://wiki.wxwidgets.org/wiki.pl?WxGLCanvas
But then I got this error:

windres.exe -i Prosjekt_3_private.rc -I rc -o Prosjekt_3_private.res -O coff
windres.exe: no resources
mingw32-make.exe: *** [Prosjekt_3_private.res] Error 1

I tried to add an empty resource to my project, and it actually compiled, but it looked very strange, some random pixels or something? I guess thats not the way to do it? Why does it ask for a .res-file? (I have never used openGL before)
Message9. Re: GLCanvas
#4336
Posted by: upCASE 2004-06-03 22:11:36
Hi!
I can't comment on that example code, but the .res error seems known to me.
If it happens again, go to your project settings and click on "GUI project" under project type. That will create the needed res file.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message10. Re: GLCanvas
#4337
Posted by: styggentorsken 2004-06-03 22:42:16
Well, it looks like the program actualy was supposed to make these random colors. I made some changes and succeded drawing a triangle (the one wich is the win32 openGL example).

Thanks a lot upCASE!!!
Heres my code for the ones who wants to try:
Im not sure if the GL-code is optimal, but it's at least working for me.

#include "wx/wx.h"
#include "wx/glcanvas.h"

#ifndef WIN32
#include <unistd.h>
#endif

class MyApp: public wxApp
{
  virtual bool OnInit();
};

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
  wxFrame *frame = new wxFrame((wxFrame *)NULL, -1,  "Hello GL World", wxPoint(50,50), wxSize(450,340) );
  wxGLCanvas * MyGLCanvas = new wxGLCanvas(frame, -1, wxPoint(0,0), wxSize(200,200), wxSUNKEN_BORDER, _("some text"));

  frame->Show(TRUE);

  MyGLCanvas->SetCurrent();
  //sleep(1);
  //..or try this instead
  wxSafeYield();
  glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            glClear (GL_COLOR_BUFFER_BIT);
            glPushMatrix ();
            glBegin (GL_TRIANGLES);
            glColor3f (1.0f, 0.0f, 0.0f);   glVertex2f (0.0f, 1.0f);
            glColor3f (0.0f, 1.0f, 0.0f);   glVertex2f (0.87f, -0.5f);
            glColor3f (0.0f, 0.0f, 1.0f);   glVertex2f (-0.87f, -0.5f);
            glPopMatrix ();
  glEnd();
  glFlush();

  MyGLCanvas->SwapBuffers();
  return TRUE;
}

phew!   at last I can start consentrating on learning openGL
  and perhaps more wxWidgets?
Thanks again
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2021-4-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0