#11  
Old 25th March 2015, 03:31 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,260
Default

Quote:
Originally Posted by RPGMaster View Post
I tried and it didn't help . I think I'm going to focus on graphics for a while though. Got bored, so I figure I should learn something new . I'd really like to get better with API's so I'll try debugging some issues.
Here I'll write up a minimalist tutorial for you

If you want to learn graphics start maybe from a little play trick: clear the screen to green pixels.

Code:
#include <GL/glut.h>

extern void do_shit_in_GL(void);
int main(int argc, char ** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(256, 256);
    glutCreateWindow("yaaay new window!");

    glutDisplayFunc(do_shit_in_GL);
    glutMainLoop(); /* keeps the window open to continuously draw frames */
    return 0;
}

void do_shit_in_GL(void)
{
    glClearColor(0, 1, 0, 1); /* 0% red, 100% green, 0% blue, 100% opacity */
    glClear(GL_COLOR_BUFFER_BIT); /* does the actual clearing the screen */
}
If you can get this to compile, you shall become the master of, filling an OpenGL viewport with a solid color.

Last edited by HatCat; 25th March 2015 at 03:33 AM.
Reply With Quote
  #12  
Old 25th March 2015, 08:01 AM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,015
Default

Well I got it to compile . Time to read up on functions so I know what to do next .
Reply With Quote
  #13  
Old 25th March 2015, 06:21 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,260
Default

uh yeah, but I forgot the glFlush in that single-buffered snippet I think =o

So if you got a black screen from building that app then it was because actually I was supposed to write this:
Code:
void do_shit_in_GL(void)
{
    glClearColor(0, 1, 0, 1);
    glClear(GL_COLOR_BUFFER_BIT);
    glFinish();
}
Reply With Quote
  #14  
Old 26th March 2015, 08:49 AM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,015
Default

Now it works after adding glFinish . I think I'm going to go straight into learning WGL, since I don't think I'll be using Linux anytime soon.
Reply With Quote
  #15  
Old 26th March 2015, 04:33 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,260
Default

WGL's useless bro and so is Windows.

GLX is used everywhere else AFAIK, except on current Macintosh which isn't surprising since Apple leads every rebellion against sanity and compatibility that there is to lead. But in principle, anything else uses GLX to establish a connection between OpenGL and X windowing system. It was the first method IIRC since SGI proposed it themselves along with OpenGL; Microsoft just couldn't use it since very little about Windows is Unix-based.
Reply With Quote
  #16  
Old 26th March 2015, 09:23 PM
V1del V1del is offline
Project Supporter
Senior Member
 
Join Date: Feb 2012
Posts: 442
Default

Its somewhat starting to get supplanted by EGL which is really possible everywhere but that's going to be a few years till that's fully the case so yeah GLX all the way currently
Reply With Quote
  #17  
Old 26th March 2015, 09:50 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,260
Default

Well yeah, I did think of that next. But then, EGL is more of an OpenGL ES thing I think?

I wouldn't at all mind OpenGL ES if it didn't serve as a constant reminder of Khronos shoving their horseshit down everyone else's throats and imposing it on the desktop/SGI OpenGL API. Past that, it is a particular interesting subset to get used to. Too bad it's also a colossal superset.

If you were planning to target mobile devices like Android or do OpenGL in JavaScript (web GL), then you would be able to use EGL instead of GLX or WGL.

If EGL really was possible everywhere, including on Windows, it probably would be forced to run as a high-level agent over WGL since Microsoft has everything closed-source anyway. So it probably wouldn't be that different from SDL or whatever.
Reply With Quote
  #18  
Old 26th March 2015, 09:51 PM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,015
Default

Quote:
Originally Posted by HatCat View Post
WGL's useless bro and so is Windows.

GLX is used everywhere else AFAIK, except on current Macintosh which isn't surprising since Apple leads every rebellion against sanity and compatibility that there is to lead. But in principle, anything else uses GLX to establish a connection between OpenGL and X windowing system. It was the first method IIRC since SGI proposed it themselves along with OpenGL; Microsoft just couldn't use it since very little about Windows is Unix-based.
You have a point about WGL ;/ . Maybe I shouldn't invest too much time into it then. I just don't feel like installing Linux ;/ . Not enough motivation atm, and I'd need to clean my computer, since I have too much junk, taking up harddrive space.

I hope using Linux will solve my issues with Z64gl though, since it's frustrating dealing to HW specific problems ;/ . I'm not a big fan of Mupen anymore though ;/ . It's unfortunate that I wouldn't be able to use my 2 favorite N64 emulators on Linux.
Reply With Quote
  #19  
Old 26th March 2015, 10:17 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,260
Default

Quote:
Originally Posted by RPGMaster View Post
You have a point about WGL ;/ . Maybe I shouldn't invest too much time into it then.
It's needed to do low-level context creation on Windows, but that's it.

As long as you don't need to do anything fancy like multi-threaded contexts or whatever, something as inside-out as SDL would work just fine. It's just that for professional utilities or dedicated engineering, the problem of high-level and unnecessary dependencies comes in for those projects and that is where you would use WGL instead of higher-level wrap-arounds.

If you were thinking to learn WGL to debug the black screen issue with my angrylion plugin, I think Intel driver issue is more pertinent to OpenGL within the thread that called it, but knowing WGL could be useful to fetch some state properties of the OpenGL context on a lower level to debug stuff. So who knows, maybe you should learn it sooner than later.

It's not at all important to learning OpenGL itself though.
I didn't even want to learn GLX, but there I was on my Internet-less laptop, with no GLUT, free GLUT, SDL, or any way to install them to my libraries to slack around the context creation problem for me. So I had to learn GLX!

But if you don't have to learn the shit then don't; I'd say just focus on OpenGL.

Quote:
Originally Posted by RPGMaster View Post
I just don't feel like installing Linux ;/ . Not enough motivation atm, and I'd need to clean my computer, since I have too much junk, taking up harddrive space.
lol didn't I say all you need to know how to do is drag and drop a slider scale for how much of Windows versus nix is partitioned to your hard disk?

As long as your disk isn't 100% full AND vacated by the same partition, there shouldn't be anything stopping you from having a Linux distro within minutes.

Quote:
Originally Posted by RPGMaster View Post
I hope using Linux will solve my issues with Z64gl though, since it's frustrating dealing to HW specific problems ;/ . I'm not a big fan of Mupen anymore though ;/ . It's unfortunate that I wouldn't be able to use my 2 favorite N64 emulators on Linux.
Not really convinced that Intel's GL drivers are any better on Linux than they are on Windows, so I guess, anything could happen.
Reply With Quote
  #20  
Old 26th March 2015, 10:32 PM
V1del V1del is offline
Project Supporter
Senior Member
 
Join Date: Feb 2012
Posts: 442
Default

Well there's still wine for that windows craving, and emulators being emulators and not often really all that dependent on obscureass windows api, usually work fine. PJ64 works pretty good didn't try 1964 yet. And you could also do a dual boot if you have some spare HDD space, best of both worlds

@EGL
Afaik you can use it with normal OGL, at least them specs pg 42 suggest so, and also read the announcements of 1.5 couldn't find the specfile for some reason though, and they also mentioned improvements with normal OGL contexts and with Wayland around the corner I'd think they are somewhat interested in having the power of normal OGL available on desktops and stuff

Dafuq why was my post so late, anyway I can somewhat vouch for Intel OGL drivers being better especially for older cards, my 2007 ass core 2 duo notebook stopped OGL driver support at 1.4 or someshit and on linux it went up to 2.1 and could do z64gl and glide64 easy which both led to a blackscreen on win lol

Last edited by V1del; 26th March 2015 at 11:09 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 09:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.