Skip to content

Commit

Permalink
Added opengl logo to the website, some minor changes to the pages and…
Browse files Browse the repository at this point in the history
… tutorial

git-svn-id: svn+ssh://rubyforge.org/var/svn/ruby-opengl/trunk@300 0bf6db90-c31b-0410-8265-cbe0ef131713
  • Loading branch information
Jan Dvorak committed Dec 15, 2007
1 parent e327df8 commit 10d77d4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ WEBSITE_MKDN = FileList['./doc/*.txt'] << 'README.txt'
NICE_HTML_DOCS = WEBSITE_MKDN.ext('html')

# defines columns in the HTML extension list
GLEXT_VERSIONS = ["svn","0.50"]
GLEXT_VERSIONS = ["svn","0.60","0.50"]

CLEAN.include("ext/gl*/Rakefile", "ext/*/mkrf.log", "ext/*/*.so",
"ext/**/*.bundle", "lib/*.so", "lib/*.bundle", "ext/*/*.o{,bj}",
Expand All @@ -44,6 +44,7 @@ CLOBBER.include("*.plain", "doc/*.plain", "doc/*.snip", "*.html",
"doc/*.html", "website/*.html", "website/images/*")
# Make sure these files aren't deleted in a clobber op
CLOBBER.exclude("website/images/tab_bottom.gif")
CLOBBER.exclude("website/images/*.jpg")

setup_extension('gl', 'gl')
setup_extension('glu', 'glu')
Expand Down
7 changes: 7 additions & 0 deletions doc/scientific_use.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ Links
* <http://narray.rubyforge.org/> -- Numerical n-dimensional Array class.
* <http://www.kitp.ucsb.edu/~paxton/tioga.html> -- Tioga. Create plots using
Ruby and TeX.

<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
1 change: 1 addition & 0 deletions doc/supplies/page_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</ul>

<div id="sidebar">
<img src="./images/ogl.jpg">
<h3>Contact</h3>
<ul>
<li><a href="http://rubyforge.org/mail/?group_id=2103">Mailing list</a></li>
Expand Down
5 changes: 5 additions & 0 deletions doc/thanks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ Aside from big thank-you's to the core devs, special thanks also goes to:
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
9 changes: 5 additions & 4 deletions doc/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ Reverse works just the same:
<a name="error_checking"></a>
Error Checking
--------------
Starting with version 0.60.0, ruby-opengl provides automatic checking of OpenGL errors.
Starting with version 0.60.0, ruby-opengl performs automatic checking of OpenGL errors.
Functions:

{{ruby}}
Gl.enable_error_checking
Gl.disable_error_checking
Gl.is_error_checking_enabled? # true/false

When the checking is enabled, glGetError() is executed after each OpenGL call, and should error
When the checking is enabled (default), glGetError() is executed after each OpenGL call, and should error
occur, Gl::Error exception is raised:

{{ruby}}
Expand All @@ -246,8 +246,9 @@ occur, Gl::Error exception is raised:
...
end

It is usually good idea to enable error checking for all your code, as OpenGL errors have habit to pop-up in
unexpected places, and the performance hit per each OpenGL call isn't that big in Ruby.
It is usually good idea to leave error checking on for all your code, as OpenGL errors have habit to pop-up in
unexpected places. For now there is no measurable performance hit for error checking, although this may change
in future ruby implementations.

<a name="examples"></a>
The Examples
Expand Down
11 changes: 6 additions & 5 deletions ext/gl/gl-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "../common/common.h"

VALUE error_checking = Qfalse;
VALUE error_checking = Qtrue;

VALUE Class_GLError;

Expand All @@ -30,7 +30,8 @@ void check_for_glerror(void)
} else { /* process errors */
char *error_string;
int queued_errors = 0;
char message[256];
const int bufsize = 256;
char message[bufsize];
VALUE exc;

/* check for queued errors */
Expand All @@ -52,9 +53,9 @@ void check_for_glerror(void)
}

if (queued_errors==0) {
snprintf(message,256,"%s",error_string);
snprintf(message,bufsize,"%s",error_string);
} else {
snprintf(message,256,"%s [%i queued error(s) cleaned]",error_string,queued_errors);
snprintf(message,bufsize,"%s [%i queued error(s) cleaned]",error_string,queued_errors);
}

exc = rb_funcall(Class_GLError, rb_intern("new"), 2, rb_str_new2(message), INT2NUM(error));
Expand Down Expand Up @@ -91,7 +92,7 @@ void gl_init_error(VALUE module)
{
Class_GLError = rb_define_class_under(module, "Error", rb_eStandardError);

rb_define_method(Class_GLError, "initialize", GLError_initialize, 2);
rb_define_method(Class_GLError, "initialize", GLError_initialize, 2);
rb_define_attr(Class_GLError, "id", 1, 0);

rb_define_module_function(module, "enable_error_checking", enable_error_checking, 0);
Expand Down
Binary file added website/images/ogl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10d77d4

Please sign in to comment.